| 1 |
dnl SPARC T1 32-bit mpn_submul_1. |
| 2 |
|
| 3 |
dnl Contributed to the GNU project by David Miller. |
| 4 |
|
| 5 |
dnl Copyright 2010, 2013 Free Software Foundation, Inc. |
| 6 |
|
| 7 |
dnl This file is part of the GNU MP Library. |
| 8 |
dnl |
| 9 |
dnl The GNU MP Library is free software; you can redistribute it and/or modify |
| 10 |
dnl it under the terms of either: |
| 11 |
dnl |
| 12 |
dnl * the GNU Lesser General Public License as published by the Free |
| 13 |
dnl Software Foundation; either version 3 of the License, or (at your |
| 14 |
dnl option) any later version. |
| 15 |
dnl |
| 16 |
dnl or |
| 17 |
dnl |
| 18 |
dnl * the GNU General Public License as published by the Free Software |
| 19 |
dnl Foundation; either version 2 of the License, or (at your option) any |
| 20 |
dnl later version. |
| 21 |
dnl |
| 22 |
dnl or both in parallel, as here. |
| 23 |
dnl |
| 24 |
dnl The GNU MP Library is distributed in the hope that it will be useful, but |
| 25 |
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 26 |
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 27 |
dnl for more details. |
| 28 |
dnl |
| 29 |
dnl You should have received copies of the GNU General Public License and the |
| 30 |
dnl GNU Lesser General Public License along with the GNU MP Library. If not, |
| 31 |
dnl see https://www.gnu.org/licenses/. |
| 32 |
|
| 33 |
include(`../config.m4') |
| 34 |
|
| 35 |
C cycles/limb |
| 36 |
C UltraSPARC T1: 24 |
| 37 |
C UltraSPARC T2: 19 |
| 38 |
C UltraSPARC T3: 19 |
| 39 |
C UltraSPARC T4: 5 |
| 40 |
|
| 41 |
C INPUT PARAMETERS |
| 42 |
define(`rp', `%i0') |
| 43 |
define(`up', `%i1') |
| 44 |
define(`n', `%i2') |
| 45 |
define(`v0', `%i3') |
| 46 |
|
| 47 |
ASM_START() |
| 48 |
PROLOGUE(mpn_submul_1) |
| 49 |
save %sp, -96, %sp |
| 50 |
srl n, 0, %o4 |
| 51 |
srl v0, 0, %g1 |
| 52 |
subcc %o4, 1, %o4 |
| 53 |
be L(final_one) |
| 54 |
subcc %g0, 0, %o5 |
| 55 |
|
| 56 |
L(top): lduw [up+0], %l0 |
| 57 |
lduw [rp+0], %l2 |
| 58 |
lduw [up+4], %l1 |
| 59 |
lduw [rp+4], %l3 |
| 60 |
mulx %l0, %g1, %g3 |
| 61 |
add up, 8, up |
| 62 |
mulx %l1, %g1, %o3 |
| 63 |
sub %o4, 2, %o4 |
| 64 |
add rp, 8, rp |
| 65 |
addx %o5, %g3, %g3 |
| 66 |
srlx %g3, 32, %o5 |
| 67 |
subcc %l2, %g3, %g3 |
| 68 |
stw %g3, [rp-8] |
| 69 |
addx %o5, %o3, %o3 |
| 70 |
srlx %o3, 32, %o5 |
| 71 |
subcc %l3, %o3, %o3 |
| 72 |
brgz %o4, L(top) |
| 73 |
stw %o3, [rp-4] |
| 74 |
|
| 75 |
brlz,pt %o4, L(done) |
| 76 |
nop |
| 77 |
|
| 78 |
L(final_one): |
| 79 |
lduw [up+0], %l0 |
| 80 |
lduw [rp+0], %l2 |
| 81 |
mulx %l0, %g1, %g3 |
| 82 |
addx %o5, %g3, %g3 |
| 83 |
srlx %g3, 32, %o5 |
| 84 |
subcc %l2, %g3, %g3 |
| 85 |
stw %g3, [rp+0] |
| 86 |
|
| 87 |
L(done): |
| 88 |
addx %o5, 0, %o5 |
| 89 |
ret |
| 90 |
restore %o5, 0, %o0 |
| 91 |
EPILOGUE() |