Skip to content

Commit d9129cb

Browse files
crypto/subtle: use PCALIGN in xorBytes
goos: linux goarch: amd64 pkg: crypto/subtle cpu: Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz │ master │ HEAD │ │ sec/op │ sec/op vs base │ XORBytes/8Bytes-8 10.90n ± 1% 10.96n ± 5% ~ (p=0.617 n=10) XORBytes/128Bytes-8 14.85n ± 2% 12.05n ± 2% -18.82% (p=0.000 n=10) XORBytes/2048Bytes-8 88.30n ± 2% 72.64n ± 1% -17.73% (p=0.000 n=10) XORBytes/32768Bytes-8 1.489µ ± 2% 1.442µ ± 1% -3.12% (p=0.000 n=10) geomean 67.91n 60.99n -10.19% │ master │ HEAD │ │ B/s │ B/s vs base │ XORBytes/8Bytes-8 700.5Mi ± 1% 696.5Mi ± 5% ~ (p=0.631 n=10) XORBytes/128Bytes-8 8.026Gi ± 2% 9.890Gi ± 2% +23.22% (p=0.000 n=10) XORBytes/2048Bytes-8 21.60Gi ± 2% 26.26Gi ± 1% +21.55% (p=0.000 n=10) XORBytes/32768Bytes-8 20.50Gi ± 2% 21.16Gi ± 1% +3.21% (p=0.000 n=10) geomean 7.022Gi 7.819Gi +11.34% For #63678
1 parent 1af424c commit d9129cb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/crypto/subtle/xor_amd64.s

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ TEXT ·xorBytes(SB), NOSPLIT, $0
1818
aligned:
1919
MOVQ $0, AX // position in slices
2020

21+
PCALIGN $16
2122
loop16b:
2223
MOVOU (SI)(AX*1), X0 // XOR 16byte forwards.
2324
MOVOU (CX)(AX*1), X1
@@ -28,6 +29,7 @@ loop16b:
2829
JNE loop16b
2930
RET
3031

32+
PCALIGN $16
3133
loop_1b:
3234
SUBQ $1, DX // XOR 1byte backwards.
3335
MOVB (SI)(DX*1), DI

0 commit comments

Comments
 (0)