Annotation of OpenXM_contrib/gmp/mpn/mips64/mul_1.asm, Revision 1.1.1.1
1.1 ohara 1: dnl MIPS64 mpn_mul_1 -- Multiply a limb vector with a single limb and store
2: dnl the product in a second limb vector.
3:
4: dnl Copyright 1992, 1994, 1995, 2000, 2001, 2002 Free Software Foundation,
5: dnl Inc.
6:
7: dnl This file is part of the GNU MP Library.
8:
9: dnl The GNU MP Library is free software; you can redistribute it and/or modify
10: dnl it under the terms of the GNU Lesser General Public License as published
11: dnl by the Free Software Foundation; either version 2.1 of the License, or (at
12: dnl your option) any later version.
13:
14: dnl The GNU MP Library is distributed in the hope that it will be useful, but
15: dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16: dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17: dnl License for more details.
18:
19: dnl You should have received a copy of the GNU Lesser General Public License
20: dnl along with the GNU MP Library; see the file COPYING.LIB. If not, write to
21: dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22: dnl MA 02111-1307, USA.
23:
24: include(`../config.m4')
25:
26: C INPUT PARAMETERS
27: C res_ptr $4
28: C s1_ptr $5
29: C size $6
30: C s2_limb $7
31:
32: ASM_START()
33: PROLOGUE(mpn_mul_1)
34:
35: C feed-in phase 0
36: ld $8,0($5)
37:
38: C feed-in phase 1
39: daddiu $5,$5,8
40: dmultu $8,$7
41:
42: daddiu $6,$6,-1
43: beq $6,$0,$LC0
44: move $2,$0 C zero cy2
45:
46: daddiu $6,$6,-1
47: beq $6,$0,$LC1
48: ld $8,0($5) C load new s1 limb as early as possible
49:
50: Loop: nop
51: mflo $10
52: mfhi $9
53: daddiu $5,$5,8
54: daddu $10,$10,$2 C add old carry limb to low product limb
55: dmultu $8,$7
56: ld $8,0($5) C load new s1 limb as early as possible
57: daddiu $6,$6,-1 C decrement loop counter
58: sltu $2,$10,$2 C carry from previous addition -> $2
59: nop
60: nop
61: sd $10,0($4)
62: daddiu $4,$4,8
63: bne $6,$0,Loop
64: daddu $2,$9,$2 C add high product limb and carry from addition
65:
66: C wind-down phase 1
67: $LC1: mflo $10
68: mfhi $9
69: daddu $10,$10,$2
70: sltu $2,$10,$2
71: dmultu $8,$7
72: sd $10,0($4)
73: daddiu $4,$4,8
74: daddu $2,$9,$2 C add high product limb and carry from addition
75:
76: C wind-down phase 0
77: $LC0: mflo $10
78: mfhi $9
79: daddu $10,$10,$2
80: sltu $2,$10,$2
81: sd $10,0($4)
82: j $31
83: daddu $2,$9,$2 C add high product limb and carry from addition
84: EPILOGUE(mpn_mul_1)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>