github.com/aergoio/aergo@v1.3.1/libtool/src/gmp-6.1.2/mpn/s390_64/lshiftc.asm (about) 1 dnl S/390-64 mpn_lshiftc. 2 3 dnl Copyright 2011, 2014 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 z900 9 35 C z990 3.5 36 C z9 ? 37 C z10 7 38 C z196 ? 39 40 C NOTES 41 C * See notes in lshift.asm. 42 43 C INPUT PARAMETERS 44 define(`rp', `%r2') 45 define(`up', `%r3') 46 define(`n', `%r4') 47 define(`cnt', `%r5') 48 49 define(`tnc', `%r6') 50 51 ASM_START() 52 PROLOGUE(mpn_lshiftc) 53 cghi n, 3 54 jh L(gt1) 55 56 stmg %r6, %r8, 48(%r15) 57 larl %r1, L(tab)-4 58 lcgr tnc, cnt 59 sllg n, n, 2 60 lghi %r8, -1 61 b 0(n,%r1) 62 L(tab): j L(n1) 63 j L(n2) 64 j L(n3) 65 66 L(n1): lg %r1, 0(up) 67 sllg %r0, %r1, 0(cnt) 68 xgr %r0, %r8 69 stg %r0, 0(rp) 70 srlg %r2, %r1, 0(tnc) 71 lmg %r6, %r8, 48(%r15) 72 br %r14 73 74 L(n2): lg %r1, 8(up) 75 srlg %r4, %r1, 0(tnc) 76 sllg %r0, %r1, 0(cnt) 77 j L(cj) 78 79 L(n3): lg %r1, 16(up) 80 srlg %r4, %r1, 0(tnc) 81 sllg %r0, %r1, 0(cnt) 82 lg %r1, 8(up) 83 srlg %r7, %r1, 0(tnc) 84 ogr %r7, %r0 85 sllg %r0, %r1, 0(cnt) 86 xgr %r7, %r8 87 stg %r7, 16(rp) 88 L(cj): lg %r1, 0(up) 89 srlg %r7, %r1, 0(tnc) 90 ogr %r7, %r0 91 sllg %r0, %r1, 0(cnt) 92 xgr %r7, %r8 93 xgr %r0, %r8 94 stg %r7, 8(rp) 95 stg %r0, 0(rp) 96 lgr %r2, %r4 97 lmg %r6, %r8, 48(%r15) 98 br %r14 99 100 L(gt1): stmg %r6, %r14, 48(%r15) 101 lcgr tnc, cnt C tnc = -cnt 102 103 sllg %r1, n, 3 104 srlg %r0, n, 2 C loop count 105 106 agr up, %r1 C point up at end of U 107 agr rp, %r1 C point rp at end of R 108 aghi up, -56 109 aghi rp, -40 110 111 lghi %r7, 3 112 lghi %r14, -1 113 ngr %r7, n 114 je L(b0) 115 cghi %r7, 2 116 jl L(b1) 117 je L(b2) 118 119 L(b3): lg %r7, 48(up) 120 srlg %r9, %r7, 0(tnc) 121 sllg %r11, %r7, 0(cnt) 122 lg %r8, 40(up) 123 lg %r7, 32(up) 124 srlg %r4, %r8, 0(tnc) 125 sllg %r13, %r8, 0(cnt) 126 ogr %r11, %r4 127 la rp, 16(rp) 128 xgr %r11, %r14 129 j L(lm3) 130 131 L(b2): lg %r8, 48(up) 132 lg %r7, 40(up) 133 srlg %r9, %r8, 0(tnc) 134 sllg %r13, %r8, 0(cnt) 135 la rp, 24(rp) 136 la up, 8(up) 137 j L(lm2) 138 139 L(b1): lg %r7, 48(up) 140 srlg %r9, %r7, 0(tnc) 141 sllg %r11, %r7, 0(cnt) 142 lg %r8, 40(up) 143 lg %r7, 32(up) 144 srlg %r4, %r8, 0(tnc) 145 sllg %r10, %r8, 0(cnt) 146 ogr %r11, %r4 147 la rp, 32(rp) 148 la up, 16(up) 149 xgr %r11, %r14 150 j L(lm1) 151 152 L(b0): lg %r8, 48(up) 153 lg %r7, 40(up) 154 srlg %r9, %r8, 0(tnc) 155 sllg %r10, %r8, 0(cnt) 156 la rp, 40(rp) 157 la up, 24(up) 158 j L(lm0) 159 160 ALIGN(8) 161 L(top): srlg %r4, %r8, 0(tnc) 162 sllg %r13, %r8, 0(cnt) 163 ogr %r11, %r4 164 xgr %r10, %r14 165 xgr %r11, %r14 166 stg %r10, 24(rp) 167 L(lm3): stg %r11, 16(rp) 168 L(lm2): srlg %r12, %r7, 0(tnc) 169 sllg %r11, %r7, 0(cnt) 170 lg %r8, 24(up) 171 lg %r7, 16(up) 172 ogr %r13, %r12 173 srlg %r4, %r8, 0(tnc) 174 sllg %r10, %r8, 0(cnt) 175 ogr %r11, %r4 176 xgr %r13, %r14 177 xgr %r11, %r14 178 stg %r13, 8(rp) 179 L(lm1): stg %r11, 0(rp) 180 L(lm0): srlg %r12, %r7, 0(tnc) 181 aghi rp, -32 182 sllg %r11, %r7, 0(cnt) 183 lg %r8, 8(up) 184 lg %r7, 0(up) 185 aghi up, -32 186 ogr %r10, %r12 187 brctg %r0, L(top) 188 189 L(end): srlg %r4, %r8, 0(tnc) 190 sllg %r13, %r8, 0(cnt) 191 ogr %r11, %r4 192 xgr %r10, %r14 193 xgr %r11, %r14 194 stg %r10, 24(rp) 195 stg %r11, 16(rp) 196 srlg %r12, %r7, 0(tnc) 197 sllg %r11, %r7, 0(cnt) 198 ogr %r13, %r12 199 xgr %r13, %r14 200 xgr %r11, %r14 201 stg %r13, 8(rp) 202 stg %r11, 0(rp) 203 lgr %r2, %r9 204 205 lmg %r6, %r14, 48(%r15) 206 br %r14 207 EPILOGUE()