Skip to content

Commit 30805c8

Browse files
committed
Merge remote-tracking branch 'origin/v4' into v4
2 parents 956d8fb + 6bd757c commit 30805c8

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

internal/lz4block/decode_amd64.s

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,24 +157,28 @@ copy_literal:
157157
CMPQ BX, R8
158158
JA err_short_buf
159159

160-
// whats a good cut off to call memmove?
161-
CMPQ CX, $16
160+
// Copy matches of <=48 bytes through the XMM registers.
161+
CMPQ CX, $48
162162
JGT memmove_lit
163163

164-
// if len(dst[di:]) < 16
164+
// if len(dst[di:]) < 48
165165
MOVQ R8, AX
166166
SUBQ DI, AX
167-
CMPQ AX, $16
167+
CMPQ AX, $48
168168
JLT memmove_lit
169169

170-
// if len(src[si:]) < 16
171-
MOVQ R9, AX
172-
SUBQ SI, AX
173-
CMPQ AX, $16
170+
// if len(src[si:]) < 48
171+
MOVQ R9, BX
172+
SUBQ SI, BX
173+
CMPQ BX, $48
174174
JLT memmove_lit
175175

176176
MOVOU (SI), X0
177+
MOVOU 16(SI), X1
178+
MOVOU 32(SI), X2
177179
MOVOU X0, (DI)
180+
MOVOU X1, 16(DI)
181+
MOVOU X2, 32(DI)
178182

179183
ADDQ CX, SI
180184
ADDQ CX, DI

0 commit comments

Comments
 (0)