Annotation of OpenXM_contrib/gmp/mpn/mips64/lshift.asm, Revision 1.1.1.1
1.1 ohara 1: dnl MIPS64 mpn_lshift -- Left shift.
2:
3: dnl Copyright 1995, 2000, 2001, 2002 Free Software Foundation, Inc.
4:
5: dnl This file is part of the GNU MP Library.
6:
7: dnl The GNU MP Library is free software; you can redistribute it and/or modify
8: dnl it under the terms of the GNU Lesser General Public License as published
9: dnl by the Free Software Foundation; either version 2.1 of the License, or (at
10: dnl your option) any later version.
11:
12: dnl The GNU MP Library is distributed in the hope that it will be useful, but
13: dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15: dnl License for more details.
16:
17: dnl You should have received a copy of the GNU Lesser General Public License
18: dnl along with the GNU MP Library; see the file COPYING.LIB. If not, write to
19: dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20: dnl MA 02111-1307, USA.
21:
22: include(`../config.m4')
23:
24: C INPUT PARAMETERS
25: C res_ptr $4
26: C src_ptr $5
27: C size $6
28: C cnt $7
29:
30: ASM_START()
31: PROLOGUE(mpn_lshift)
32: dsll $2,$6,3
33: daddu $5,$5,$2 C make r5 point at end of src
34: ld $10,-8($5) C load first limb
35: dsubu $13,$0,$7
36: daddu $4,$4,$2 C make r4 point at end of res
37: daddiu $6,$6,-1
38: and $9,$6,4-1 C number of limbs in first loop
39: beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
40: dsrl $2,$10,$13 C compute function result
41:
42: dsubu $6,$6,$9
43:
44: .Loop0: ld $3,-16($5)
45: daddiu $4,$4,-8
46: daddiu $5,$5,-8
47: daddiu $9,$9,-1
48: dsll $11,$10,$7
49: dsrl $12,$3,$13
50: move $10,$3
51: or $8,$11,$12
52: bne $9,$0,.Loop0
53: sd $8,0($4)
54:
55: .L0: beq $6,$0,.Lend
56: nop
57:
58: .Loop: ld $3,-16($5)
59: daddiu $4,$4,-32
60: daddiu $6,$6,-4
61: dsll $11,$10,$7
62: dsrl $12,$3,$13
63:
64: ld $10,-24($5)
65: dsll $14,$3,$7
66: or $8,$11,$12
67: sd $8,24($4)
68: dsrl $9,$10,$13
69:
70: ld $3,-32($5)
71: dsll $11,$10,$7
72: or $8,$14,$9
73: sd $8,16($4)
74: dsrl $12,$3,$13
75:
76: ld $10,-40($5)
77: dsll $14,$3,$7
78: or $8,$11,$12
79: sd $8,8($4)
80: dsrl $9,$10,$13
81:
82: daddiu $5,$5,-32
83: or $8,$14,$9
84: bgtz $6,.Loop
85: sd $8,0($4)
86:
87: .Lend: dsll $8,$10,$7
88: j $31
89: sd $8,-8($4)
90: EPILOGUE(mpn_lshift)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>