sm2ec: arm64 register reuse issue

This commit is contained in:
Sun Yimin 2023-06-14 17:53:13 +08:00 committed by GitHub
parent a8791437f8
commit 66eae26312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -293,7 +293,7 @@ TEXT ·p256FromMont(SB),NOSPLIT,$0
/* ---------------------------------------*/ /* ---------------------------------------*/
// func p256Select(res *SM2P256Point, table *p256Table, idx, limit int) // func p256Select(res *SM2P256Point, table *p256Table, idx, limit int)
TEXT ·p256Select(SB),NOSPLIT,$0 TEXT ·p256Select(SB),NOSPLIT,$0
MOVD limit+24(FP), const3 MOVD limit+24(FP), a_ptr
MOVD idx+16(FP), const0 MOVD idx+16(FP), const0
MOVD table+8(FP), b_ptr MOVD table+8(FP), b_ptr
MOVD res+0(FP), res_ptr MOVD res+0(FP), res_ptr
@ -335,7 +335,7 @@ loop_select:
CSEL EQ, acc2, t2, t2 CSEL EQ, acc2, t2, t2
CSEL EQ, acc3, t3, t3 CSEL EQ, acc3, t3, t3
CMP const3, const1 CMP a_ptr, const1
BNE loop_select BNE loop_select
STP (x0, x1), 0*16(res_ptr) STP (x0, x1), 0*16(res_ptr)