github.com/parquet-go/parquet-go@v0.20.0/hashprobe/wyhash/wyhash_amd64.s (about)

     1  //go:build !purego
     2  
     3  #include "textflag.h"
     4  
     5  #define m1 0xa0761d6478bd642f
     6  #define m2 0xe7037ed1a0b428db
     7  #define m3 0x8ebc6af09c88c6e3
     8  #define m4 0x589965cc75374cc3
     9  #define m5 0x1d8e4e27c47d124f
    10  
    11  // func MultiHashUint32Array(hashes []uintptr, values sparse.Uint32Array, seed uintptr)
    12  TEXT ·MultiHashUint32Array(SB), NOSPLIT, $0-56
    13      MOVQ hashes_base+0(FP), R12
    14      MOVQ values_array_ptr+24(FP), R13
    15      MOVQ values_array_len+32(FP), R14
    16      MOVQ values_array_off+40(FP), R15
    17      MOVQ seed+48(FP), R11
    18  
    19      MOVQ $m1, R8
    20      MOVQ $m2, R9
    21      MOVQ $m5^4, R10
    22      XORQ R11, R8
    23  
    24      XORQ SI, SI
    25      JMP test
    26  loop:
    27      MOVL (R13), AX
    28      MOVQ R8, BX
    29  
    30      XORQ AX, BX
    31      XORQ R9, AX
    32  
    33      MULQ BX
    34      XORQ DX, AX
    35  
    36      MULQ R10
    37      XORQ DX, AX
    38  
    39      MOVQ AX, (R12)(SI*8)
    40      INCQ SI
    41      ADDQ R15, R13
    42  test:
    43      CMPQ SI, R14
    44      JNE loop
    45      RET
    46  
    47  // func MultiHashUint64Array(hashes []uintptr, values sparse.Uint64Array, seed uintptr)
    48  TEXT ·MultiHashUint64Array(SB), NOSPLIT, $0-56
    49      MOVQ hashes_base+0(FP), R12
    50      MOVQ values_array_ptr+24(FP), R13
    51      MOVQ values_array_len+32(FP), R14
    52      MOVQ values_array_off+40(FP), R15
    53      MOVQ seed+48(FP), R11
    54  
    55      MOVQ $m1, R8
    56      MOVQ $m2, R9
    57      MOVQ $m5^8, R10
    58      XORQ R11, R8
    59  
    60      XORQ SI, SI
    61      JMP test
    62  loop:
    63      MOVQ (R13), AX
    64      MOVQ R8, BX
    65  
    66      XORQ AX, BX
    67      XORQ R9, AX
    68  
    69      MULQ BX
    70      XORQ DX, AX
    71  
    72      MULQ R10
    73      XORQ DX, AX
    74  
    75      MOVQ AX, (R12)(SI*8)
    76      INCQ SI
    77      ADDQ R15, R13
    78  test:
    79      CMPQ SI, R14
    80      JNE loop
    81      RET
    82  
    83  // func MultiHashUint128Array(hashes []uintptr, values sparse.Uint128Array, seed uintptr)
    84  TEXT ·MultiHashUint128Array(SB), NOSPLIT, $0-56
    85      MOVQ hashes_base+0(FP), R12
    86      MOVQ values_array_ptr+24(FP), R13
    87      MOVQ values_array_len+32(FP), R14
    88      MOVQ values_array_off+40(FP), R15
    89      MOVQ seed+48(FP), R11
    90  
    91      MOVQ $m1, R8
    92      MOVQ $m2, R9
    93      MOVQ $m5^16, R10
    94      XORQ R11, R8
    95  
    96      XORQ SI, SI
    97      JMP test
    98  loop:
    99      MOVQ 0(R13), AX
   100      MOVQ 8(R13), DX
   101      MOVQ R8, BX
   102  
   103      XORQ DX, BX
   104      XORQ R9, AX
   105  
   106      MULQ BX
   107      XORQ DX, AX
   108  
   109      MULQ R10
   110      XORQ DX, AX
   111  
   112      MOVQ AX, (R12)(SI*8)
   113      INCQ SI
   114      ADDQ R15, R13
   115  test:
   116      CMPQ SI, R14
   117      JNE loop
   118      RET