Annotation of OpenXM_contrib/gmp/mpn/mips3/mul_1.s, Revision 1.1.1.2
1.1.1.2 ! maekawa 1: # MIPS3 __gmpn_mul_1 -- Multiply a limb vector with a single limb and
1.1 maekawa 2: # store the product in a second limb vector.
3:
1.1.1.2 ! maekawa 4: # Copyright (C) 1992, 1994, 1995, 2000 Free Software Foundation, Inc.
1.1 maekawa 5:
6: # This file is part of the GNU MP Library.
7:
8: # The GNU MP Library is free software; you can redistribute it and/or modify
1.1.1.2 ! maekawa 9: # it under the terms of the GNU Lesser General Public License as published by
! 10: # the Free Software Foundation; either version 2.1 of the License, or (at your
1.1 maekawa 11: # option) any later version.
12:
13: # The GNU MP Library is distributed in the hope that it will be useful, but
14: # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1.1.1.2 ! maekawa 15: # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
1.1 maekawa 16: # License for more details.
17:
1.1.1.2 ! maekawa 18: # You should have received a copy of the GNU Lesser General Public License
1.1 maekawa 19: # along with the GNU MP Library; see the file COPYING.LIB. If not, write to
20: # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21: # MA 02111-1307, USA.
22:
23:
24: # INPUT PARAMETERS
25: # res_ptr $4
26: # s1_ptr $5
27: # size $6
28: # s2_limb $7
29:
30: .text
31: .align 4
1.1.1.2 ! maekawa 32: .globl __gmpn_mul_1
! 33: .ent __gmpn_mul_1
! 34: __gmpn_mul_1:
1.1 maekawa 35: .set noreorder
36: .set nomacro
37:
38: # warm up phase 0
39: ld $8,0($5)
40:
41: # warm up phase 1
42: daddiu $5,$5,8
43: dmultu $8,$7
44:
45: daddiu $6,$6,-1
46: beq $6,$0,$LC0
47: move $2,$0 # zero cy2
48:
49: daddiu $6,$6,-1
50: beq $6,$0,$LC1
51: ld $8,0($5) # load new s1 limb as early as possible
52:
53: Loop: mflo $10
54: mfhi $9
55: daddiu $5,$5,8
56: daddu $10,$10,$2 # add old carry limb to low product limb
57: dmultu $8,$7
58: ld $8,0($5) # load new s1 limb as early as possible
59: daddiu $6,$6,-1 # decrement loop counter
60: sltu $2,$10,$2 # carry from previous addition -> $2
61: sd $10,0($4)
62: daddiu $4,$4,8
63: bne $6,$0,Loop
64: daddu $2,$9,$2 # add high product limb and carry from addition
65:
66: # cool 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 # add high product limb and carry from addition
75:
76: # cool 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 # add high product limb and carry from addition
84:
1.1.1.2 ! maekawa 85: .end __gmpn_mul_1
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>