github.com/pingcap/badger@v1.5.1-0.20230103063557-828f39b09b6d/surf/bits_amd64.s (about)

     1  TEXT ·select64(SB),$24-24
     2      MOVQ    x+0(FP), AX
     3      MOVQ    k+8(FP), CX
     4      CMPB    ·hasBMI2(SB), $0
     5      JEQ     fallback
     6      DECQ    CX
     7      MOVQ    $1, BX
     8      SHLQ    CX, BX
     9      PDEPQ   AX, BX, BX
    10      TZCNTQ  BX, BX
    11      MOVQ    BX, ret+16(FP)
    12      RET
    13  fallback:
    14      MOVQ    AX, (SP)
    15      MOVQ    CX, 8(SP)
    16      CALL    ·select64Broadword(SB)
    17      MOVQ    16(SP), AX
    18      MOVQ    AX, ret+16(FP)
    19      RET