|
Packit |
5c3484 |
dnl MIPS64 mpn_mul_1 -- Multiply a limb vector with a single limb and store
|
|
Packit |
5c3484 |
dnl the product in a second limb vector.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl Copyright 1992, 1994, 1995, 2000-2002 Free Software Foundation, Inc.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl This file is part of the GNU MP Library.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl The GNU MP Library is free software; you can redistribute it and/or modify
|
|
Packit |
5c3484 |
dnl it under the terms of either:
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl * the GNU Lesser General Public License as published by the Free
|
|
Packit |
5c3484 |
dnl Software Foundation; either version 3 of the License, or (at your
|
|
Packit |
5c3484 |
dnl option) any later version.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl or
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl * the GNU General Public License as published by the Free Software
|
|
Packit |
5c3484 |
dnl Foundation; either version 2 of the License, or (at your option) any
|
|
Packit |
5c3484 |
dnl later version.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl or both in parallel, as here.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl The GNU MP Library is distributed in the hope that it will be useful, but
|
|
Packit |
5c3484 |
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
Packit |
5c3484 |
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
Packit |
5c3484 |
dnl for more details.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl You should have received copies of the GNU General Public License and the
|
|
Packit |
5c3484 |
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
|
|
Packit |
5c3484 |
dnl see https://www.gnu.org/licenses/.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
include(`../config.m4')
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C INPUT PARAMETERS
|
|
Packit |
5c3484 |
C res_ptr $4
|
|
Packit |
5c3484 |
C s1_ptr $5
|
|
Packit |
5c3484 |
C size $6
|
|
Packit |
5c3484 |
C s2_limb $7
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
ASM_START()
|
|
Packit |
5c3484 |
PROLOGUE(mpn_mul_1)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C feed-in phase 0
|
|
Packit |
5c3484 |
ld $8,0($5)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C feed-in phase 1
|
|
Packit |
5c3484 |
daddiu $5,$5,8
|
|
Packit |
5c3484 |
dmultu $8,$7
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
daddiu $6,$6,-1
|
|
Packit |
5c3484 |
beq $6,$0,$LC0
|
|
Packit |
5c3484 |
move $2,$0 C zero cy2
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
daddiu $6,$6,-1
|
|
Packit |
5c3484 |
beq $6,$0,$LC1
|
|
Packit |
5c3484 |
ld $8,0($5) C load new s1 limb as early as possible
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
Loop: nop
|
|
Packit |
5c3484 |
mflo $10
|
|
Packit |
5c3484 |
mfhi $9
|
|
Packit |
5c3484 |
daddiu $5,$5,8
|
|
Packit |
5c3484 |
daddu $10,$10,$2 C add old carry limb to low product limb
|
|
Packit |
5c3484 |
dmultu $8,$7
|
|
Packit |
5c3484 |
ld $8,0($5) C load new s1 limb as early as possible
|
|
Packit |
5c3484 |
daddiu $6,$6,-1 C decrement loop counter
|
|
Packit |
5c3484 |
sltu $2,$10,$2 C carry from previous addition -> $2
|
|
Packit |
5c3484 |
nop
|
|
Packit |
5c3484 |
nop
|
|
Packit |
5c3484 |
sd $10,0($4)
|
|
Packit |
5c3484 |
daddiu $4,$4,8
|
|
Packit |
5c3484 |
bne $6,$0,Loop
|
|
Packit |
5c3484 |
daddu $2,$9,$2 C add high product limb and carry from addition
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C wind-down phase 1
|
|
Packit |
5c3484 |
$LC1: mflo $10
|
|
Packit |
5c3484 |
mfhi $9
|
|
Packit |
5c3484 |
daddu $10,$10,$2
|
|
Packit |
5c3484 |
sltu $2,$10,$2
|
|
Packit |
5c3484 |
dmultu $8,$7
|
|
Packit |
5c3484 |
sd $10,0($4)
|
|
Packit |
5c3484 |
daddiu $4,$4,8
|
|
Packit |
5c3484 |
daddu $2,$9,$2 C add high product limb and carry from addition
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C wind-down phase 0
|
|
Packit |
5c3484 |
$LC0: mflo $10
|
|
Packit |
5c3484 |
mfhi $9
|
|
Packit |
5c3484 |
daddu $10,$10,$2
|
|
Packit |
5c3484 |
sltu $2,$10,$2
|
|
Packit |
5c3484 |
sd $10,0($4)
|
|
Packit |
5c3484 |
j $31
|
|
Packit |
5c3484 |
daddu $2,$9,$2 C add high product limb and carry from addition
|
|
Packit |
5c3484 |
EPILOGUE(mpn_mul_1)
|