forked from Shiloh/githaven
86e2789960
* update github.com/PuerkitoBio/goquery * update github.com/alecthomas/chroma * update github.com/blevesearch/bleve/v2 * update github.com/caddyserver/certmagic * update github.com/go-enry/go-enry/v2 * update github.com/go-git/go-billy/v5 * update github.com/go-git/go-git/v5 * update github.com/go-redis/redis/v8 * update github.com/go-testfixtures/testfixtures/v3 * update github.com/jaytaylor/html2text * update github.com/json-iterator/go * update github.com/klauspost/compress * update github.com/markbates/goth * update github.com/mattn/go-isatty * update github.com/mholt/archiver/v3 * update github.com/microcosm-cc/bluemonday * update github.com/minio/minio-go/v7 * update github.com/prometheus/client_golang * update github.com/unrolled/render * update github.com/xanzy/go-gitlab * update github.com/yuin/goldmark * update github.com/yuin/goldmark-highlighting Co-authored-by: techknowlogick <techknowlogick@gitea.io>
105 lines
1.7 KiB
ArmAsm
Vendored
105 lines
1.7 KiB
ArmAsm
Vendored
// +build !go1.9
|
|
// +build amd64,!appengine
|
|
|
|
TEXT ·hasAsm(SB),4,$0-1
|
|
MOVQ $1, AX
|
|
CPUID
|
|
SHRQ $23, CX
|
|
ANDQ $1, CX
|
|
MOVB CX, ret+0(FP)
|
|
RET
|
|
|
|
#define POPCNTQ_DX_DX BYTE $0xf3; BYTE $0x48; BYTE $0x0f; BYTE $0xb8; BYTE $0xd2
|
|
|
|
TEXT ·popcntSliceAsm(SB),4,$0-32
|
|
XORQ AX, AX
|
|
MOVQ s+0(FP), SI
|
|
MOVQ s_len+8(FP), CX
|
|
TESTQ CX, CX
|
|
JZ popcntSliceEnd
|
|
popcntSliceLoop:
|
|
BYTE $0xf3; BYTE $0x48; BYTE $0x0f; BYTE $0xb8; BYTE $0x16 // POPCNTQ (SI), DX
|
|
ADDQ DX, AX
|
|
ADDQ $8, SI
|
|
LOOP popcntSliceLoop
|
|
popcntSliceEnd:
|
|
MOVQ AX, ret+24(FP)
|
|
RET
|
|
|
|
TEXT ·popcntMaskSliceAsm(SB),4,$0-56
|
|
XORQ AX, AX
|
|
MOVQ s+0(FP), SI
|
|
MOVQ s_len+8(FP), CX
|
|
TESTQ CX, CX
|
|
JZ popcntMaskSliceEnd
|
|
MOVQ m+24(FP), DI
|
|
popcntMaskSliceLoop:
|
|
MOVQ (DI), DX
|
|
NOTQ DX
|
|
ANDQ (SI), DX
|
|
POPCNTQ_DX_DX
|
|
ADDQ DX, AX
|
|
ADDQ $8, SI
|
|
ADDQ $8, DI
|
|
LOOP popcntMaskSliceLoop
|
|
popcntMaskSliceEnd:
|
|
MOVQ AX, ret+48(FP)
|
|
RET
|
|
|
|
TEXT ·popcntAndSliceAsm(SB),4,$0-56
|
|
XORQ AX, AX
|
|
MOVQ s+0(FP), SI
|
|
MOVQ s_len+8(FP), CX
|
|
TESTQ CX, CX
|
|
JZ popcntAndSliceEnd
|
|
MOVQ m+24(FP), DI
|
|
popcntAndSliceLoop:
|
|
MOVQ (DI), DX
|
|
ANDQ (SI), DX
|
|
POPCNTQ_DX_DX
|
|
ADDQ DX, AX
|
|
ADDQ $8, SI
|
|
ADDQ $8, DI
|
|
LOOP popcntAndSliceLoop
|
|
popcntAndSliceEnd:
|
|
MOVQ AX, ret+48(FP)
|
|
RET
|
|
|
|
TEXT ·popcntOrSliceAsm(SB),4,$0-56
|
|
XORQ AX, AX
|
|
MOVQ s+0(FP), SI
|
|
MOVQ s_len+8(FP), CX
|
|
TESTQ CX, CX
|
|
JZ popcntOrSliceEnd
|
|
MOVQ m+24(FP), DI
|
|
popcntOrSliceLoop:
|
|
MOVQ (DI), DX
|
|
ORQ (SI), DX
|
|
POPCNTQ_DX_DX
|
|
ADDQ DX, AX
|
|
ADDQ $8, SI
|
|
ADDQ $8, DI
|
|
LOOP popcntOrSliceLoop
|
|
popcntOrSliceEnd:
|
|
MOVQ AX, ret+48(FP)
|
|
RET
|
|
|
|
TEXT ·popcntXorSliceAsm(SB),4,$0-56
|
|
XORQ AX, AX
|
|
MOVQ s+0(FP), SI
|
|
MOVQ s_len+8(FP), CX
|
|
TESTQ CX, CX
|
|
JZ popcntXorSliceEnd
|
|
MOVQ m+24(FP), DI
|
|
popcntXorSliceLoop:
|
|
MOVQ (DI), DX
|
|
XORQ (SI), DX
|
|
POPCNTQ_DX_DX
|
|
ADDQ DX, AX
|
|
ADDQ $8, SI
|
|
ADDQ $8, DI
|
|
LOOP popcntXorSliceLoop
|
|
popcntXorSliceEnd:
|
|
MOVQ AX, ret+48(FP)
|
|
RET
|