Skip to content

Commit

Permalink
Merge pull request #286 from tevador/pr-zext
Browse files Browse the repository at this point in the history
RISC-V: Avoid `zext.b`
  • Loading branch information
tevador authored Oct 20, 2023
2 parents e5b9c02 + e895d45 commit 73d70fe
Showing 1 changed file with 32 additions and 32 deletions.
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

0 comments on commit 73d70fe

Please sign in to comment.