github.com/minio/simdjson-go@v0.4.6-0.20231116094823-04d21cddf993/find_odd_backslash_sequences_amd64.s (about)

     1  //+build !noasm !appengine gc
     2  // AUTO-GENERATED BY C2GOASM -- DO NOT EDIT
     3  
     4  DATA LCDATA1<>+0x000(SB)/8, $0x5c5c5c5c5c5c5c5c
     5  DATA LCDATA1<>+0x008(SB)/8, $0x5c5c5c5c5c5c5c5c
     6  DATA LCDATA1<>+0x010(SB)/8, $0x5c5c5c5c5c5c5c5c
     7  DATA LCDATA1<>+0x018(SB)/8, $0x5c5c5c5c5c5c5c5c
     8  GLOBL LCDATA1<>(SB), 8, $32
     9  
    10  TEXT ·_find_odd_backslash_sequences(SB), $0-24
    11  
    12  	MOVQ p1+0(FP), DI
    13  	MOVQ p3+8(FP), DX
    14  
    15  	VMOVDQU (DI), Y8     // load low 32-bytes
    16  	VMOVDQU 0x20(DI), Y9 // load high 32-bytes
    17  
    18  	CALL ·__find_odd_backslash_sequences(SB)
    19  
    20  	VZEROUPPER
    21  	MOVQ AX, result+16(FP)
    22  	RET
    23  
    24  TEXT ·__find_odd_backslash_sequences(SB), $0
    25  	LEAQ      LCDATA1<>(SB), R8
    26  	VMOVDQA   (R8), Y0           // vmovdqa    ymm0, yword 0[rbp] /* [rip + LCPI0_0] */
    27  	VPCMPEQB  Y8/*(DI)*/, Y0, Y1 // vpcmpeqb    ymm1, ymm0, yword [rdi]
    28  	VPMOVMSKB Y1, CX             // vpmovmskb    ecx, ymm1
    29  	VPCMPEQB  Y9/*(SI)*/, Y0, Y0 // vpcmpeqb    ymm0, ymm0, yword [rsi]
    30  	VPMOVMSKB Y0, AX             // vpmovmskb    eax, ymm0
    31  	SHLQ      $32, AX            // shl    rax, 32
    32  	ORQ       CX, AX             // or    rax, rcx
    33  
    34  #define FIND_ODD_BACKSLASH_SEQUENCES \
    35  	LEAQ  (AX)(AX*1), CX           \ // lea    rcx, [rax + rax]
    36  	NOTQ  CX                       \ // not    rcx
    37  	ANDQ  AX, CX                   \ // and    rcx, rax
    38  	WORD  $0x8b4c; BYTE $0x0a      \ // mov    r9, qword [rdx]
    39  	MOVQ  $0x5555555555555555, R8  \ // mov    r8, 6148914691236517205
    40  	MOVQ  R9, SI                   \ // mov    rsi, r9
    41  	XORQ  R8, SI                   \ // xor    rsi, r8
    42  	ANDQ  CX, SI                   \ // and    rsi, rcx
    43  	MOVQ  $0xaaaaaaaaaaaaaaaa, R10 \ // mov    r10, -6148914691236517206
    44  	MOVQ  R9, DI                   \ // mov    rdi, r9
    45  	XORQ  R10, DI                  \ // xor    rdi, r10
    46  	ANDQ  CX, DI                   \ // and    rdi, rcx
    47  	ADDQ  AX, SI                   \ // add    rsi, rax
    48  	XORL  CX, CX                   \ // xor    ecx, ecx
    49  	ADDQ  AX, DI                   \ // add    rdi, rax
    50  	SETCS CX                       \ // setb    cl
    51  	ORQ   R9, DI                   \ // or    rdi, r9
    52  	MOVQ  CX, (DX)                 \ // mov    qword [rdx], rcx
    53  	NOTQ  AX                       \ // not    rax
    54  	ANDQ  AX, R10                  \ // and    r10, rax
    55  	ANDQ  SI, R10                  \ // and    r10, rsi
    56  	ANDQ  R8, AX                   \ // and    rax, r8
    57  	ANDQ  DI, AX                   \ // and    rax, rdi
    58  	ORQ   R10, AX                  // or    rax, r10
    59  
    60  	FIND_ODD_BACKSLASH_SEQUENCES
    61  	RET
    62  
    63  #define OBSS_CONST Z16
    64  
    65  TEXT ·_find_odd_backslash_sequences_avx512(SB), $0-24
    66  
    67  	MOVQ p1+0(FP), DI
    68  	MOVQ p3+8(FP), DX
    69  
    70  	VMOVDQU32 (DI), Z8
    71  
    72  	CALL ·__init_odd_backslash_sequences_avx512(SB)
    73  	CALL ·__find_odd_backslash_sequences_avx512(SB)
    74  
    75  	VZEROUPPER
    76  	MOVQ AX, result+16(FP)
    77  	RET
    78  
    79  TEXT ·__init_odd_backslash_sequences_avx512(SB), $0
    80  	MOVQ         $0x5c, AX
    81  	VPBROADCASTB AX, OBSS_CONST
    82  	RET
    83  
    84  TEXT ·__find_odd_backslash_sequences_avx512(SB), $0
    85  	VPCMPEQB Z8, OBSS_CONST, K1
    86  	KMOVQ    K1, AX
    87  	FIND_ODD_BACKSLASH_SEQUENCES
    88  	RET