Skip to content

Commit

Permalink
internal/subtle: apply VLM/VSTM in non-loop
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun authored Aug 28, 2024
1 parent 40bd384 commit 45584cc
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions internal/subtle/xor_s390x.s
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,37 @@ TEXT ·xorBytes(SB),NOSPLIT,$0-32
CMPBLT R4, $64, tail

loop_64:
VLM 0(R2)(R5*1), V0, V3
VLM 0(R3)(R5*1), V4, V7
VL 0(R2)(R5*1), V0
VL 16(R2)(R5*1), V1
VL 32(R2)(R5*1), V2
VL 48(R2)(R5*1), V3
VL 0(R3)(R5*1), V4
VL 16(R3)(R5*1), V5
VL 32(R3)(R5*1), V6
VL 48(R3)(R5*1), V7
VX V0, V4, V4
VX V1, V5, V5
VX V2, V6, V6
VX V3, V7, V7
VSTM V4, V7, 0(R1)(R5*1)
VST V4, 0(R1)(R5*1)
VST V5, 16(R1)(R5*1)
VST V6, 32(R1)(R5*1)
VST V7, 48(R1)(R5*1)
LAY 64(R5), R5
SUB $64, R4
CMPBGE R4, $64, loop_64

tail:
CMPBEQ R4, $0, done
CMPBLT R4, $32, less_than32
VL 0(R2)(R5*1), V0
VL 16(R2)(R5*1), V1
VL 0(R3)(R5*1), V2
VL 16(R3)(R5*1), V3
VLM 0(R2)(R5*1), V0, V1
//VL 16(R2)(R5*1), V1
VLM 0(R3)(R5*1), V2, V3
//VL 16(R3)(R5*1), V3
VX V0, V2, V2
VX V1, V3, V3
VST V2, 0(R1)(R5*1)
VST V3, 16(R1)(R5*1)
VSTM V2, V3, 0(R1)(R5*1)
//VST V3, 16(R1)(R5*1)
LAY 32(R5), R5
SUB $32, R4

Expand Down

0 comments on commit 45584cc

Please sign in to comment.