Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RISC-V: Avoid zext.b #286

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions src/jit_compiler_rv64_static.S
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ softaes_enc:
#endif

/* byte 0 */
zext.b x14, x30
andi x14, x30, 255
srli x30, x30, 8
addi x12, x13, -2048
#ifdef __riscv_zba
Expand All @@ -757,7 +757,7 @@ softaes_enc:
lwu x14, -2048(x14)

/* byte 1 */
zext.b x15, x30
andi x15, x30, 255
srli x30, x30, 8
#ifdef __riscv_zba
sh2add x15, x15, x12
Expand All @@ -769,7 +769,7 @@ softaes_enc:
xor x8, x8, x14

/* byte 2 */
zext.b x14, x30
andi x14, x30, 255
srli x30, x30, 8
#ifdef __riscv_zba
sh2add x14, x14, x13
Expand All @@ -781,7 +781,7 @@ softaes_enc:
xor x11, x11, x15

/* byte 3 */
zext.b x15, x30
andi x15, x30, 255
srli x30, x30, 8
#ifdef __riscv_zba
sh2add x15, x15, x13
Expand All @@ -793,7 +793,7 @@ softaes_enc:
xor x10, x10, x14

/* byte 4 */
zext.b x14, x30
andi x14, x30, 255
srli x30, x30, 8
#ifdef __riscv_zba
sh2add x14, x14, x12
Expand All @@ -805,7 +805,7 @@ softaes_enc:
xor x9, x9, x15

/* byte 5 */
zext.b x15, x30
andi x15, x30, 255
srli x30, x30, 8
#ifdef __riscv_zba
sh2add x15, x15, x12
Expand All @@ -817,7 +817,7 @@ softaes_enc:
xor x9, x9, x14

/* byte 6 */
zext.b x14, x30
andi x14, x30, 255
srli x30, x30, 8
#ifdef __riscv_zba
sh2add x14, x14, x13
Expand All @@ -829,7 +829,7 @@ softaes_enc:
xor x8, x8, x15

/* byte 7 */
zext.b x15, x30
andi x15, x30, 255
#ifdef __riscv_zba
sh2add x15, x15, x13
#else
Expand All @@ -840,7 +840,7 @@ softaes_enc:
xor x11, x11, x14

/* byte 8 */
zext.b x14, x31
andi x14, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x14, x14, x12
Expand All @@ -852,7 +852,7 @@ softaes_enc:
xor x10, x10, x15

/* byte 9 */
zext.b x15, x31
andi x15, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x15, x15, x12
Expand All @@ -864,7 +864,7 @@ softaes_enc:
xor x10, x10, x14

/* byte 10 */
zext.b x14, x31
andi x14, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x14, x14, x13
Expand All @@ -876,7 +876,7 @@ softaes_enc:
xor x9, x9, x15

/* byte 11 */
zext.b x15, x31
andi x15, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x15, x15, x13
Expand All @@ -888,7 +888,7 @@ softaes_enc:
xor x8, x8, x14

/* byte 12 */
zext.b x14, x31
andi x14, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x14, x14, x12
Expand All @@ -900,7 +900,7 @@ softaes_enc:
xor x11, x11, x15

/* byte 13 */
zext.b x15, x31
andi x15, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x15, x15, x12
Expand All @@ -912,7 +912,7 @@ softaes_enc:
xor x11, x11, x14

/* byte 14 */
zext.b x14, x31
andi x14, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x14, x14, x13
Expand All @@ -924,7 +924,7 @@ softaes_enc:
xor x10, x10, x15

/* byte 15 */
zext.b x15, x31
andi x15, x31, 255
#ifdef __riscv_zba
sh2add x15, x15, x13
#else
Expand Down Expand Up @@ -960,7 +960,7 @@ softaes_dec:
#endif

/* byte 0 */
zext.b x14, x30
andi x14, x30, 255
srli x30, x30, 8
addi x12, x13, -2048
#ifdef __riscv_zba
Expand All @@ -972,7 +972,7 @@ softaes_dec:
lwu x14, -2048(x14)

/* byte 1 */
zext.b x15, x30
andi x15, x30, 255
srli x30, x30, 8
#ifdef __riscv_zba
sh2add x15, x15, x12
Expand All @@ -984,7 +984,7 @@ softaes_dec:
xor x8, x8, x14

/* byte 2 */
zext.b x14, x30
andi x14, x30, 255
srli x30, x30, 8
#ifdef __riscv_zba
sh2add x14, x14, x13
Expand All @@ -996,7 +996,7 @@ softaes_dec:
xor x9, x9, x15

/* byte 3 */
zext.b x15, x30
andi x15, x30, 255
srli x30, x30, 8
#ifdef __riscv_zba
sh2add x15, x15, x13
Expand All @@ -1008,7 +1008,7 @@ softaes_dec:
xor x10, x10, x14

/* byte 4 */
zext.b x14, x30
andi x14, x30, 255
srli x30, x30, 8
#ifdef __riscv_zba
sh2add x14, x14, x12
Expand All @@ -1020,7 +1020,7 @@ softaes_dec:
xor x11, x11, x15

/* byte 5 */
zext.b x15, x30
andi x15, x30, 255
srli x30, x30, 8
#ifdef __riscv_zba
sh2add x15, x15, x12
Expand All @@ -1032,7 +1032,7 @@ softaes_dec:
xor x9, x9, x14

/* byte 6 */
zext.b x14, x30
andi x14, x30, 255
srli x30, x30, 8
#ifdef __riscv_zba
sh2add x14, x14, x13
Expand All @@ -1044,7 +1044,7 @@ softaes_dec:
xor x10, x10, x15

/* byte 7 */
zext.b x15, x30
andi x15, x30, 255
#ifdef __riscv_zba
sh2add x15, x15, x13
#else
Expand All @@ -1055,7 +1055,7 @@ softaes_dec:
xor x11, x11, x14

/* byte 8 */
zext.b x14, x31
andi x14, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x14, x14, x12
Expand All @@ -1067,7 +1067,7 @@ softaes_dec:
xor x8, x8, x15

/* byte 9 */
zext.b x15, x31
andi x15, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x15, x15, x12
Expand All @@ -1079,7 +1079,7 @@ softaes_dec:
xor x10, x10, x14

/* byte 10 */
zext.b x14, x31
andi x14, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x14, x14, x13
Expand All @@ -1091,7 +1091,7 @@ softaes_dec:
xor x11, x11, x15

/* byte 11 */
zext.b x15, x31
andi x15, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x15, x15, x13
Expand All @@ -1103,7 +1103,7 @@ softaes_dec:
xor x8, x8, x14

/* byte 12 */
zext.b x14, x31
andi x14, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x14, x14, x12
Expand All @@ -1115,7 +1115,7 @@ softaes_dec:
xor x9, x9, x15

/* byte 13 */
zext.b x15, x31
andi x15, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x15, x15, x12
Expand All @@ -1127,7 +1127,7 @@ softaes_dec:
xor x11, x11, x14

/* byte 14 */
zext.b x14, x31
andi x14, x31, 255
srli x31, x31, 8
#ifdef __riscv_zba
sh2add x14, x14, x13
Expand All @@ -1139,7 +1139,7 @@ softaes_dec:
xor x8, x8, x15

/* byte 15 */
zext.b x15, x31
andi x15, x31, 255
#ifdef __riscv_zba
sh2add x15, x15, x13
#else
Expand Down