summaryrefslogtreecommitdiff
path: root/mpn
diff options
context:
space:
mode:
authorTorbjorn Granlund <tg@gmplib.org>2021-11-14 15:33:53 +0100
committerTorbjorn Granlund <tg@gmplib.org>2021-11-14 15:33:53 +0100
commit8bd635b865326ea7392e46c665594508c9ab973d (patch)
tree6ae500aa8f4e7c17e210436e93a2208791bc620d /mpn
parent1a499c7ccd1ad85b4b92b76aa0bed5f572bd148d (diff)
downloadgmp-8bd635b865326ea7392e46c665594508c9ab973d.tar.gz
Accept 4th CMPCY operand, allowing for 2 c/l mpn_sub_n (mpn_add_n cannot beat 3 c/l with RISC V's ISA).
Diffstat (limited to 'mpn')
-rw-r--r--mpn/riscv/64/aors_n.asm10
1 files changed, 5 insertions, 5 deletions
diff --git a/mpn/riscv/64/aors_n.asm b/mpn/riscv/64/aors_n.asm
index 6e38083c8..f3ec4ce59 100644
--- a/mpn/riscv/64/aors_n.asm
+++ b/mpn/riscv/64/aors_n.asm
@@ -43,7 +43,7 @@ ifdef(`OPERATION_add_n',`
')
ifdef(`OPERATION_sub_n',`
define(`ADDSUB', `sub')
- define(`CMPCY', `sltu $1, $3, $2')
+ define(`CMPCY', `sltu $1, $3, $4')
define(`func', `mpn_sub_n')
')
@@ -66,9 +66,9 @@ L(top): ld a4, 0(up)
addi n, n, -2 C bookkeeping
addi up, up, 16 C bookkeeping
ADDSUB t0, a4, a6
- CMPCY( t2, t0, a4)
+ CMPCY( t2, t0, a4, a6)
ADDSUB t4, t0, t6 C cycle 3, 9, ...
- CMPCY( t3, t4, t0) C cycle 4, 10, ...
+ CMPCY( t3, t4, t0, t6) C cycle 4, 10, ...
sd t4, 0(rp)
add t6, t2, t3 C cycle 5, 11, ...
L(mid): ld a5, -8(up)
@@ -76,9 +76,9 @@ L(mid): ld a5, -8(up)
addi vp, vp, 16 C bookkeeping
addi rp, rp, 16 C bookkeeping
ADDSUB t1, a5, a7
- CMPCY( t2, t1, a5)
+ CMPCY( t2, t1, a5, a7)
ADDSUB t4, t1, t6 C cycle 0, 6, ...
- CMPCY( t3, t4, t1) C cycle 1, 7, ...
+ CMPCY( t3, t4, t1, t6) C cycle 1, 7, ...
sd t4, -8(rp)
add t6, t2, t3 C cycle 2, 8, ...
bne n, x0, L(top) C bookkeeping