Skip to content

Commit 3f8c9e0

Browse files
committed
mask_amd64.s: Minor improvements
1 parent cb7509a commit 3f8c9e0

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

frame.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ func writeFrameHeader(h header, w *bufio.Writer, buf []byte) (err error) {
184184
// to be in little endian.
185185
//
186186
// See https://github.com/golang/go/issues/31586
187+
//
188+
//lint:ignore U1000 mask.go
187189
func maskGo(key uint32, b []byte) uint32 {
188190
if len(b) >= 8 {
189191
key64 := uint64(key)<<32 | uint64(key)

mask_amd64.s

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ TEXT ·maskAsm(SB), NOSPLIT, $0-28
1717
SHLQ $32, DI
1818
ORQ DX, DI
1919

20-
CMPQ CX, $15
21-
JLE less_than_16
20+
CMPQ CX, $7
21+
JLE less_than_8
2222
CMPQ CX, $63
2323
JLE less_than_64
2424
CMPQ CX, $128
@@ -58,7 +58,7 @@ unaligned_loop:
5858
JMP sse
5959

6060
sse:
61-
CMPQ CX, $0x40
61+
CMPQ CX, $64
6262
JL less_than_64
6363
MOVQ DI, X0
6464
PUNPCKLQDQ X0, X0
@@ -76,9 +76,9 @@ sse_loop:
7676
MOVOU X2, 1*16(AX)
7777
MOVOU X3, 2*16(AX)
7878
MOVOU X4, 3*16(AX)
79-
ADDQ $0x40, AX
80-
SUBQ $0x40, CX
81-
CMPQ CX, $0x40
79+
ADDQ $64, AX
80+
SUBQ $64, CX
81+
CMPQ CX, $64
8282
JAE sse_loop
8383

8484
less_than_64:

0 commit comments

Comments
 (0)