Skip to content

Commit

Permalink
internal/bytealg: compare_amd64 alignment optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
qiulaidongfeng committed Oct 23, 2023
1 parent bc2124d commit 281c2ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/internal/bytealg/compare_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ TEXT cmpbody<>(SB),NOSPLIT,$0-0
#else
JMP big_loop_avx2
#endif
PCALIGN $16
loop:
CMPQ R8, $16
JBE _0through16
Expand Down Expand Up @@ -161,6 +162,7 @@ allsame:

// this works for >= 64 bytes of data.
#ifndef hasAVX2
PCALIGN $16
big_loop:
MOVOU (SI), X0
MOVOU (DI), X1
Expand Down Expand Up @@ -200,6 +202,7 @@ big_loop:

// Compare 64-bytes per loop iteration.
// Loop is unrolled and uses AVX2.
PCALIGN $32
big_loop_avx2:
VMOVDQU (SI), Y2
VMOVDQU (DI), Y3
Expand Down

0 comments on commit 281c2ab

Please sign in to comment.