1 1.1 mrg dnl SPARC T1 32-bit mpn_add_n. 2 1.1 mrg 3 1.1 mrg dnl Copyright 2010 Free Software Foundation, Inc. 4 1.1 mrg 5 1.1 mrg dnl This file is part of the GNU MP Library. 6 1.1.1.2 mrg dnl 7 1.1 mrg dnl The GNU MP Library is free software; you can redistribute it and/or modify 8 1.1.1.2 mrg dnl it under the terms of either: 9 1.1.1.2 mrg dnl 10 1.1.1.2 mrg dnl * the GNU Lesser General Public License as published by the Free 11 1.1.1.2 mrg dnl Software Foundation; either version 3 of the License, or (at your 12 1.1.1.2 mrg dnl option) any later version. 13 1.1.1.2 mrg dnl 14 1.1.1.2 mrg dnl or 15 1.1.1.2 mrg dnl 16 1.1.1.2 mrg dnl * the GNU General Public License as published by the Free Software 17 1.1.1.2 mrg dnl Foundation; either version 2 of the License, or (at your option) any 18 1.1.1.2 mrg dnl later version. 19 1.1.1.2 mrg dnl 20 1.1.1.2 mrg dnl or both in parallel, as here. 21 1.1.1.2 mrg dnl 22 1.1 mrg dnl The GNU MP Library is distributed in the hope that it will be useful, but 23 1.1 mrg dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 24 1.1.1.2 mrg dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 25 1.1.1.2 mrg dnl for more details. 26 1.1.1.2 mrg dnl 27 1.1.1.2 mrg dnl You should have received copies of the GNU General Public License and the 28 1.1.1.2 mrg dnl GNU Lesser General Public License along with the GNU MP Library. If not, 29 1.1.1.2 mrg dnl see https://www.gnu.org/licenses/. 30 1.1 mrg 31 1.1 mrg include(`../config.m4') 32 1.1 mrg 33 1.1 mrg C INPUT PARAMETERS 34 1.1 mrg define(`rp', %o0) 35 1.1 mrg define(`ap', %o1) 36 1.1 mrg define(`bp', %o2) 37 1.1 mrg define(`n', %o3) 38 1.1 mrg define(`cy', %o4) 39 1.1 mrg 40 1.1 mrg define(`i', %o3) 41 1.1 mrg 42 1.1 mrg MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc) 43 1.1 mrg 44 1.1 mrg ASM_START() 45 1.1 mrg PROLOGUE(mpn_add_nc) 46 1.1 mrg b L(ent) 47 1.1 mrg srl cy, 0, cy C strip any bogus high bits 48 1.1 mrg EPILOGUE() 49 1.1 mrg 50 1.1 mrg PROLOGUE(mpn_add_n) 51 1.1 mrg mov 0, cy 52 1.1 mrg L(ent): srl n, 0, n C strip any bogus high bits 53 1.1 mrg sll n, 2, n 54 1.1 mrg add ap, n, ap 55 1.1 mrg add bp, n, bp 56 1.1 mrg add rp, n, rp 57 1.1 mrg neg n, i 58 1.1 mrg 59 1.1 mrg L(top): lduw [ap+i], %g1 60 1.1 mrg lduw [bp+i], %g2 61 1.1 mrg add %g1, %g2, %g3 62 1.1 mrg add %g3, cy, %g3 63 1.1 mrg stw %g3, [rp+i] 64 1.1 mrg add i, 4, i 65 1.1 mrg brnz i, L(top) 66 1.1 mrg srlx %g3, 32, cy 67 1.1 mrg 68 1.1 mrg retl 69 1.1 mrg mov cy, %o0 C return value 70 1.1 mrg EPILOGUE() 71