Annotation of OpenXM_contrib/gmp/mpn/arm/mul_1.asm, Revision 1.1.1.1
1.1 ohara 1: dnl ARM mpn_mul_1 -- Multiply a limb vector with a limb and store the result
2: dnl in a second limb vector.
3: dnl Contributed by Robert Harley.
4:
5: dnl Copyright 1998, 2000, 2001 Free Software Foundation, 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 This runs at 7.75 cycles/limb in the StrongARM.
27:
28: define(`rp',`r0')
29: define(`up',`r1')
30: define(`n',`r2')
31: define(`v',`r3')
32:
33:
34: ASM_START()
35: PROLOGUE(mpn_mul_1)
36: stmfd sp!, { r8, r9, lr }
37: ands ip, n, #1
38: beq L(skip1)
39: ldr lr, [up], #4
40: umull r9, ip, v, lr
41: str r9, [rp], #4
42: L(skip1):
43: tst n, #2
44: beq L(skip2)
45: mov r8, ip
46: ldmia up!, { ip, lr }
47: mov r9, #0
48: umlal r8, r9, v, ip
49: mov ip, #0
50: umlal r9, ip, v, lr
51: stmia rp!, { r8, r9 }
52: L(skip2):
53: bics n, n, #3
54: beq L(return)
55: stmfd sp!, { r6, r7 }
56: L(mul_1_loop):
57: mov r6, ip
58: ldmia up!, { r8, r9, ip, lr }
59: ldr r7, [rp, #12] C cache allocate
60: mov r7, #0
61: umlal r6, r7, v, r8
62: mov r8, #0
63: umlal r7, r8, v, r9
64: mov r9, #0
65: umlal r8, r9, v, ip
66: mov ip, #0
67: umlal r9, ip, v, lr
68: subs n, n, #4
69: stmia rp!, { r6, r7, r8, r9 }
70: bne L(mul_1_loop)
71: ldmfd sp!, { r6, r7 }
72: L(return):
73: mov r0, ip
74: ldmfd sp!, { r8, r9, pc }
75: EPILOGUE(mpn_mul_1)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>