Annotation of OpenXM_contrib/gmp/mpn/sparc64/lshift.asm, Revision 1.1.1.2
1.1.1.2 ! ohara 1: dnl SPARC v9 mpn_lshift
1.1 maekawa 2:
1.1.1.2 ! ohara 3: dnl Copyright 1996, 2000, 2001, 2002 Free Software Foundation, Inc.
1.1 maekawa 4:
1.1.1.2 ! ohara 5: dnl This file is part of the GNU MP Library.
1.1 maekawa 6:
1.1.1.2 ! ohara 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 by
! 9: dnl the Free Software Foundation; either version 2.1 of the License, or (at your
! 10: dnl 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.
1.1 maekawa 21:
1.1.1.2 ! ohara 22: include(`../config.m4')
1.1 maekawa 23:
1.1.1.2 ! ohara 24: C INPUT PARAMETERS
! 25: define(`rp',`%i0')
! 26: define(`up',`%i1')
! 27: define(`n',`%i2')
! 28: define(`cnt',`%i3')
! 29:
! 30: define(`u0',`%l0')
! 31: define(`u1',`%l2')
! 32: define(`u2',`%l4')
! 33: define(`u3',`%l6')
1.1 maekawa 34:
1.1.1.2 ! ohara 35: define(`tnc',`%i4')
1.1 maekawa 36:
1.1.1.2 ! ohara 37: define(`fanop',`fitod %f0,%f2') dnl A quasi nop running in the FA pipe
! 38: define(`fmnop',`fmuld %f0,%f0,%f4') dnl A quasi nop running in the FM pipe
1.1 maekawa 39:
40: ASM_START()
1.1.1.2 ! ohara 41: REGISTER(%g2,#scratch)
! 42: REGISTER(%g3,#scratch)
1.1 maekawa 43: PROLOGUE(mpn_lshift)
1.1.1.2 ! ohara 44: save %sp,-160,%sp
! 45:
! 46: sllx n,3,%g1
! 47: sub %g0,cnt,tnc C negate shift count
! 48: add up,%g1,up C make %o1 point at end of src
! 49: add rp,%g1,rp C make %o0 point at end of res
! 50: ldx [up-8],u3 C load first limb
! 51: subcc n,5,n
! 52: srlx u3,tnc,%i5 C compute function result
! 53: sllx u3,cnt,%g3
! 54: bl,pn %icc,.Lend1234
! 55: fanop
! 56:
! 57: subcc n,4,n
! 58: ldx [up-16],u0
! 59: ldx [up-24],u1
! 60: add up,-32,up
! 61: ldx [up-0],u2
! 62: ldx [up-8],u3
! 63: srlx u0,tnc,%g2
! 64:
! 65: bl,pn %icc,.Lend5678
! 66: fanop
! 67:
! 68: b,a .Loop
! 69: .align 16
! 70: .Loop:
! 71: sllx u0,cnt,%g1
! 72: or %g3,%g2,%g3
! 73: ldx [up-16],u0
! 74: fanop
! 75: C --
! 76: srlx u1,tnc,%g2
! 77: subcc n,4,n
! 78: stx %g3,[rp-8]
! 79: fanop
! 80: C --
! 81: sllx u1,cnt,%g3
! 82: or %g1,%g2,%g1
! 83: ldx [up-24],u1
! 84: fanop
! 85: C --
! 86: srlx u2,tnc,%g2
! 87: stx %g1,[rp-16]
! 88: add up,-32,up
! 89: fanop
! 90: C --
! 91: sllx u2,cnt,%g1
! 92: or %g3,%g2,%g3
! 93: ldx [up-0],u2
! 94: fanop
! 95: C --
! 96: srlx u3,tnc,%g2
! 97: stx %g3,[rp-24]
! 98: add rp,-32,rp
! 99: fanop
! 100: C --
! 101: sllx u3,cnt,%g3
! 102: or %g1,%g2,%g1
! 103: ldx [up-8],u3
! 104: fanop
! 105: C --
! 106: srlx u0,tnc,%g2
! 107: stx %g1,[rp-0]
! 108: bge,pt %icc,.Loop
! 109: fanop
! 110: C --
! 111: .Lend5678:
! 112: sllx u0,cnt,%g1
! 113: or %g3,%g2,%g3
! 114: srlx u1,tnc,%g2
! 115: stx %g3,[rp-8]
! 116: sllx u1,cnt,%g3
! 117: or %g1,%g2,%g1
! 118: srlx u2,tnc,%g2
! 119: stx %g1,[rp-16]
! 120: sllx u2,cnt,%g1
! 121: or %g3,%g2,%g3
! 122: srlx u3,tnc,%g2
! 123: stx %g3,[rp-24]
! 124: add rp,-32,rp
! 125: sllx u3,cnt,%g3 C carry...
! 126: or %g1,%g2,%g1
! 127: stx %g1,[rp-0]
! 128:
! 129: .Lend1234:
! 130: addcc n,4,n
! 131: bz,pn %icc,.Lret
! 132: fanop
! 133: .Loop0:
! 134: add rp,-8,rp
! 135: subcc n,1,n
! 136: ldx [up-16],u3
! 137: add up,-8,up
! 138: srlx u3,tnc,%g2
! 139: or %g3,%g2,%g3
! 140: stx %g3,[rp]
! 141: sllx u3,cnt,%g3
! 142: bnz,pt %icc,.Loop0
! 143: fanop
! 144: .Lret:
! 145: stx %g3,[rp-8]
! 146: mov %i5,%i0
! 147: ret
! 148: restore
1.1 maekawa 149: EPILOGUE(mpn_lshift)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>