indexbyte2_amd64.go
This file
Path
src/algo/indexbyte2_amd64.go
24 lines · 563 bytes · Go
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 76efddd point at it.
bash: shift-delete to delete history entries during CTRL-RJunegunn Choibefore adoption76efddd
lines 1–24why, one step back1//go:build amd6423package algo45var _useAVX2 bool67func init() {8 _useAVX2 = cpuHasAVX2()9}1011//go:noescape12func cpuHasAVX2() bool1314// indexByteTwo returns the index of the first occurrence of b1 or b2 in s,15// or -1 if neither is present. Uses AVX2 when available, SSE2 otherwise.16//17//go:noescape18func IndexByteTwo(s []byte, b1, b2 byte) int1920// lastIndexByteTwo returns the index of the last occurrence of b1 or b2 in s,21// or -1 if neither is present. Uses AVX2 when available, SSE2 otherwise.22//23//go:noescape24func lastIndexByteTwo(s []byte, b1, b2 byte) int