beta-0.89.2
[luatex.git] / source / libs / gmp / gmp-src / mpn / sparc64 / ultrasparct1 / sublshC_n.asm
blob01eafef1bce7db1803ae74fd09b4dab0a384dba2
1 dnl SPARC v9 mpn_sublshC_n for T1/T2.
3 dnl Copyright 2010 Free Software Foundation, Inc.
5 dnl This file is part of the GNU MP Library.
6 dnl
7 dnl The GNU MP Library is free software; you can redistribute it and/or modify
8 dnl it under the terms of either:
9 dnl
10 dnl * the GNU Lesser General Public License as published by the Free
11 dnl Software Foundation; either version 3 of the License, or (at your
12 dnl option) any later version.
13 dnl
14 dnl or
15 dnl
16 dnl * the GNU General Public License as published by the Free Software
17 dnl Foundation; either version 2 of the License, or (at your option) any
18 dnl later version.
19 dnl
20 dnl or both in parallel, as here.
21 dnl
22 dnl The GNU MP Library is distributed in the hope that it will be useful, but
23 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25 dnl for more details.
26 dnl
27 dnl You should have received copies of the GNU General Public License and the
28 dnl GNU Lesser General Public License along with the GNU MP Library. If not,
29 dnl see https://www.gnu.org/licenses/.
31 C cycles/limb
32 C UltraSPARC T1: 21
33 C UltraSPARC T2: ?
35 C INPUT PARAMETERS
36 define(`rp', `%o0')
37 define(`up', `%o1')
38 define(`vp', `%o2')
39 define(`n', `%o3')
40 define(`cy', `%o4')
42 ASM_START()
43 REGISTER(%g2,#scratch)
44 REGISTER(%g3,#scratch)
45 PROLOGUE(func)
46 mov 0, cy
47 mov 0, %g5
48 cmp %g0, cy
49 L(top): ldx [up+0], %o4
50 add up, 8, up
51 ldx [vp+0], %o5
52 add vp, 8, vp
53 add rp, 8, rp
55 sllx %o5, LSH, %g4
56 add n, -1, n
57 or %g5, %g4, %g4
58 srlx %o5, RSH, %g5
60 srlx %o4, 32, %g1
61 srlx %g4, 32, %g2
62 subccc %o4, %g4, %g3
63 subccc %g1, %g2, %g0
64 brgz n, L(top)
65 stx %g3, [rp-8]
67 retl
68 addc %g5, %g0, %o0
69 EPILOGUE()