|
Packit |
5c3484 |
dnl MIPS32 mpn_submul_1 -- Multiply a limb vector with a single limb and
|
|
Packit |
5c3484 |
dnl subtract the product from a second limb vector.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl Copyright 1992, 1994, 1996, 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_submul_1)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C feed-in phase 0
|
|
Packit |
5c3484 |
lw $8,0($5)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C feed-in phase 1
|
|
Packit |
5c3484 |
addiu $5,$5,4
|
|
Packit |
5c3484 |
multu $8,$7
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
addiu $6,$6,-1
|
|
Packit |
5c3484 |
beq $6,$0,$LC0
|
|
Packit |
5c3484 |
move $2,$0 C zero cy2
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
addiu $6,$6,-1
|
|
Packit |
5c3484 |
beq $6,$0,$LC1
|
|
Packit |
5c3484 |
lw $8,0($5) C load new s1 limb as early as possible
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
Loop: lw $10,0($4)
|
|
Packit |
5c3484 |
mflo $3
|
|
Packit |
5c3484 |
mfhi $9
|
|
Packit |
5c3484 |
addiu $5,$5,4
|
|
Packit |
5c3484 |
addu $3,$3,$2 C add old carry limb to low product limb
|
|
Packit |
5c3484 |
multu $8,$7
|
|
Packit |
5c3484 |
lw $8,0($5) C load new s1 limb as early as possible
|
|
Packit |
5c3484 |
addiu $6,$6,-1 C decrement loop counter
|
|
Packit |
5c3484 |
sltu $2,$3,$2 C carry from previous addition -> $2
|
|
Packit |
5c3484 |
subu $3,$10,$3
|
|
Packit |
5c3484 |
sgtu $10,$3,$10
|
|
Packit |
5c3484 |
addu $2,$2,$10
|
|
Packit |
5c3484 |
sw $3,0($4)
|
|
Packit |
5c3484 |
addiu $4,$4,4
|
|
Packit |
5c3484 |
bne $6,$0,Loop
|
|
Packit |
5c3484 |
addu $2,$9,$2 C add high product limb and carry from addition
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C wind-down phase 1
|
|
Packit |
5c3484 |
$LC1: lw $10,0($4)
|
|
Packit |
5c3484 |
mflo $3
|
|
Packit |
5c3484 |
mfhi $9
|
|
Packit |
5c3484 |
addu $3,$3,$2
|
|
Packit |
5c3484 |
sltu $2,$3,$2
|
|
Packit |
5c3484 |
multu $8,$7
|
|
Packit |
5c3484 |
subu $3,$10,$3
|
|
Packit |
5c3484 |
sgtu $10,$3,$10
|
|
Packit |
5c3484 |
addu $2,$2,$10
|
|
Packit |
5c3484 |
sw $3,0($4)
|
|
Packit |
5c3484 |
addiu $4,$4,4
|
|
Packit |
5c3484 |
addu $2,$9,$2 C add high product limb and carry from addition
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C wind-down phase 0
|
|
Packit |
5c3484 |
$LC0: lw $10,0($4)
|
|
Packit |
5c3484 |
mflo $3
|
|
Packit |
5c3484 |
mfhi $9
|
|
Packit |
5c3484 |
addu $3,$3,$2
|
|
Packit |
5c3484 |
sltu $2,$3,$2
|
|
Packit |
5c3484 |
subu $3,$10,$3
|
|
Packit |
5c3484 |
sgtu $10,$3,$10
|
|
Packit |
5c3484 |
addu $2,$2,$10
|
|
Packit |
5c3484 |
sw $3,0($4)
|
|
Packit |
5c3484 |
j $31
|
|
Packit |
5c3484 |
addu $2,$9,$2 C add high product limb and carry from addition
|
|
Packit |
5c3484 |
EPILOGUE(mpn_submul_1)
|