Skip to content

Commit

Permalink
internal/subtle: s390x rollback first
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun authored Aug 28, 2024
1 parent d3727e7 commit e3fba24
Showing 1 changed file with 3 additions and 26 deletions.
29 changes: 3 additions & 26 deletions internal/subtle/xor_s390x.s
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,16 @@ TEXT ·xorBytes(SB),NOSPLIT,$0-32
MOVD n+24(FP), R4

MOVD $0, R5
CMPBLT R4, $64, less_than64

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

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

less_than32:
CMPBLT R4, $16, less_than16

loop16b:
VL 0(R2)(R5*1), V0
VL 0(R3)(R5*1), V1
VX V0, V1, V2
VST V2, 0(R1)(R5*1)
LAY 16(R5), R5
SUB $16, R4
CMPBGE R4, $16, loop16b

less_than16:
CMPBLT R4, $8, tail
Expand Down

1 comment on commit e3fba24

@emmansun
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.