summaryrefslogtreecommitdiff
path: root/rts/gmp/mpn/powerpc64/mul_1.asm
blob: 47597283ffa511c8c95aa4b920074f7dd09c11f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# PowerPC-64 mpn_mul_1 -- Multiply a limb vector with a limb and store
# the result in a second limb vector.

# Copyright (C) 1999, 2000 Free Software Foundation, Inc.

# This file is part of the GNU MP Library.

# The GNU MP Library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or (at your
# option) any later version.

# The GNU MP Library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
# License for more details.

# You should have received a copy of the GNU Lesser General Public License
# along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.


# INPUT PARAMETERS
# res_ptr	r3
# s1_ptr	r4
# size		r5
# s2_limb	r6

include(`../config.m4')

ASM_START()
PROLOGUE(mpn_mul_1)
	mtctr	5
	li	9,0		# cy_limb = 0
	addic	0,0,0
	cal	3,-8(3)
	cal	4,-8(4)
.Loop:
	ldu	0,8(4)
	mulld	7,0,6
	adde	7,7,9
	mulhdu	9,0,6
	stdu	7,8(3)
	bdnz	.Loop

	addze	3,9
	blr
EPILOGUE(mpn_mul_1)