1dnl MIPS64 mpn_mul_1 -- Multiply a limb vector with a single limb and store 2dnl the product in a second limb vector. 3 4dnl Copyright 1992, 1994, 1995, 2000-2002 Free Software Foundation, Inc. 5 6dnl This file is part of the GNU MP Library. 7dnl 8dnl The GNU MP Library is free software; you can redistribute it and/or modify 9dnl it under the terms of either: 10dnl 11dnl * the GNU Lesser General Public License as published by the Free 12dnl Software Foundation; either version 3 of the License, or (at your 13dnl option) any later version. 14dnl 15dnl or 16dnl 17dnl * the GNU General Public License as published by the Free Software 18dnl Foundation; either version 2 of the License, or (at your option) any 19dnl later version. 20dnl 21dnl or both in parallel, as here. 22dnl 23dnl The GNU MP Library is distributed in the hope that it will be useful, but 24dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 25dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 26dnl for more details. 27dnl 28dnl You should have received copies of the GNU General Public License and the 29dnl GNU Lesser General Public License along with the GNU MP Library. If not, 30dnl see https://www.gnu.org/licenses/. 31 32include(`../config.m4') 33 34C INPUT PARAMETERS 35C res_ptr $4 36C s1_ptr $5 37C size $6 38C s2_limb $7 39 40ASM_START() 41PROLOGUE(mpn_mul_1) 42 43C feed-in phase 0 44 ld $8,0($5) 45 46C feed-in phase 1 47 daddiu $5,$5,8 48 dmultu $8,$7 49 50 daddiu $6,$6,-1 51 beq $6,$0,$LC0 52 move $2,$0 C zero cy2 53 54 daddiu $6,$6,-1 55 beq $6,$0,$LC1 56 ld $8,0($5) C load new s1 limb as early as possible 57 58Loop: nop 59 mflo $10 60 mfhi $9 61 daddiu $5,$5,8 62 daddu $10,$10,$2 C add old carry limb to low product limb 63 dmultu $8,$7 64 ld $8,0($5) C load new s1 limb as early as possible 65 daddiu $6,$6,-1 C decrement loop counter 66 sltu $2,$10,$2 C carry from previous addition -> $2 67 nop 68 nop 69 sd $10,0($4) 70 daddiu $4,$4,8 71 bne $6,$0,Loop 72 daddu $2,$9,$2 C add high product limb and carry from addition 73 74C wind-down phase 1 75$LC1: mflo $10 76 mfhi $9 77 daddu $10,$10,$2 78 sltu $2,$10,$2 79 dmultu $8,$7 80 sd $10,0($4) 81 daddiu $4,$4,8 82 daddu $2,$9,$2 C add high product limb and carry from addition 83 84C wind-down phase 0 85$LC0: mflo $10 86 mfhi $9 87 daddu $10,$10,$2 88 sltu $2,$10,$2 89 sd $10,0($4) 90 j $31 91 daddu $2,$9,$2 C add high product limb and carry from addition 92EPILOGUE(mpn_mul_1) 93