Austin Schuh | dace2a6 | 2020-08-18 10:56:48 -0700 | [diff] [blame^] | 1 | dnl SPARC v9 mpn_copyi -- Copy a limb vector, incrementing. |
| 2 | |
| 3 | dnl Copyright 1999-2003 Free Software Foundation, Inc. |
| 4 | |
| 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/. |
| 30 | |
| 31 | include(`../config.m4') |
| 32 | |
| 33 | C cycles/limb |
| 34 | C UltraSPARC 1&2: 2 |
| 35 | C UltraSPARC 3: 2.5 |
| 36 | C UltraSPARC T1: 17 |
| 37 | C UltraSPARC T3: 6 |
| 38 | C UltraSPARC T4/T5: 2 |
| 39 | |
| 40 | C INPUT PARAMETERS |
| 41 | C rptr %o0 |
| 42 | C sptr %o1 |
| 43 | C n %o2 |
| 44 | |
| 45 | ASM_START() |
| 46 | REGISTER(%g2,#scratch) |
| 47 | REGISTER(%g3,#scratch) |
| 48 | PROLOGUE(mpn_copyi) |
| 49 | addcc %o2,-8,%o2 |
| 50 | bl,pt %xcc,L(end01234567) |
| 51 | nop |
| 52 | L(loop1): |
| 53 | ldx [%o1+0],%g1 |
| 54 | ldx [%o1+8],%g2 |
| 55 | ldx [%o1+16],%g3 |
| 56 | ldx [%o1+24],%g4 |
| 57 | ldx [%o1+32],%g5 |
| 58 | ldx [%o1+40],%o3 |
| 59 | ldx [%o1+48],%o4 |
| 60 | ldx [%o1+56],%o5 |
| 61 | add %o1,64,%o1 |
| 62 | stx %g1,[%o0+0] |
| 63 | stx %g2,[%o0+8] |
| 64 | stx %g3,[%o0+16] |
| 65 | stx %g4,[%o0+24] |
| 66 | stx %g5,[%o0+32] |
| 67 | stx %o3,[%o0+40] |
| 68 | stx %o4,[%o0+48] |
| 69 | stx %o5,[%o0+56] |
| 70 | addcc %o2,-8,%o2 |
| 71 | bge,pt %xcc,L(loop1) |
| 72 | add %o0,64,%o0 |
| 73 | L(end01234567): |
| 74 | addcc %o2,8,%o2 |
| 75 | bz,pn %xcc,L(end) |
| 76 | nop |
| 77 | L(loop2): |
| 78 | ldx [%o1+0],%g1 |
| 79 | add %o1,8,%o1 |
| 80 | addcc %o2,-1,%o2 |
| 81 | stx %g1,[%o0+0] |
| 82 | bg,pt %xcc,L(loop2) |
| 83 | add %o0,8,%o0 |
| 84 | L(end): retl |
| 85 | nop |
| 86 | EPILOGUE(mpn_copyi) |