]> Cypherpunks repositories - gostls13.git/commitdiff
internal/chacha8rand: replace WORD with instruction VMOVQ
authorXiaolin Zhao <zhaoxiaolin@loongson.cn>
Thu, 19 Jun 2025 13:03:27 +0000 (21:03 +0800)
committerabner chenc <chenguoqi@loongson.cn>
Wed, 6 Aug 2025 01:02:27 +0000 (18:02 -0700)
Change-Id: I5d05af4d071b4b0ee60fafbd2a39494128bdf3f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/682896
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/internal/chacha8rand/chacha8_loong64.s

index caa1426a054967f4e77bd654c2927dcdbbf15c26..5e6857ed3a65982f847c3446e3855a0f28361198 100644 (file)
@@ -49,35 +49,23 @@ lsx_chacha8:
        MOVV    $·chachaIncRot(SB), R11
 
        // load contants
-       // VLDREPL.W  $0, R10, V0
-       WORD    $0x30200140
-       // VLDREPL.W  $1, R10, V1
-       WORD    $0x30200541
-       // VLDREPL.W  $2, R10, V2
-       WORD    $0x30200942
-       // VLDREPL.W  $3, R10, V3
-       WORD    $0x30200d43
+       VMOVQ   (R10), V0.W4
+       VMOVQ   1(R10), V1.W4
+       VMOVQ   2(R10), V2.W4
+       VMOVQ   3(R10), V3.W4
 
        // load 4-32bit data from incRotMatrix added to counter
        VMOVQ   (R11), V30
 
        // load seed
-       // VLDREPL.W  $0, R4, V4
-       WORD    $0x30200084
-       // VLDREPL.W  $1, R4, V5
-       WORD    $0x30200485
-       // VLDREPL.W  $2, R4, V6
-       WORD    $0x30200886
-       // VLDREPL.W  $3, R4, V7
-       WORD    $0x30200c87
-       // VLDREPL.W  $4, R4, V8
-       WORD    $0x30201088
-       // VLDREPL.W  $5, R4, V9
-       WORD    $0x30201489
-       // VLDREPL.W  $6, R4, V10
-       WORD    $0x3020188a
-       // VLDREPL.W  $7, R4, V11
-       WORD    $0x30201c8b
+       VMOVQ   (R4), V4.W4
+       VMOVQ   1(R4), V5.W4
+       VMOVQ   2(R4), V6.W4
+       VMOVQ   3(R4), V7.W4
+       VMOVQ   4(R4), V8.W4
+       VMOVQ   5(R4), V9.W4
+       VMOVQ   6(R4), V10.W4
+       VMOVQ   7(R4), V11.W4
 
        // load counter and update counter
        VMOVQ   R6, V12.W4