-
Notifications
You must be signed in to change notification settings - Fork 6
/
select_386.go
41 lines (31 loc) · 1.14 KB
/
select_386.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2020 Robert Clausecker <[email protected]>
package pospop
import "golang.org/x/sys/cpu"
func count8avx2(counts *[8]int, buf []byte)
func count8sse2(counts *[8]int, buf []byte)
func count16avx2(counts *[16]int, buf []uint16)
func count16sse2(counts *[16]int, buf []uint16)
func count32avx2(counts *[32]int, buf []uint32)
func count32sse2(counts *[32]int, buf []uint32)
func count64sse2(counts *[64]int, buf []uint64)
func count64avx2(counts *[64]int, buf []uint64)
var count8funcs = []count8impl{
{count8avx2, "avx2", cpu.X86.HasAVX2 && cpu.X86.HasBMI2},
{count8sse2, "sse2", cpu.X86.HasSSE2},
{count8generic, "generic", true},
}
var count16funcs = []count16impl{
{count16avx2, "avx2", cpu.X86.HasAVX2 && cpu.X86.HasBMI2},
{count16sse2, "sse2", cpu.X86.HasSSE2},
{count16generic, "generic", true},
}
var count32funcs = []count32impl{
{count32avx2, "avx2", cpu.X86.HasAVX2 && cpu.X86.HasBMI2},
{count32sse2, "sse2", cpu.X86.HasSSE2},
{count32generic, "generic", true},
}
var count64funcs = []count64impl{
{count64avx2, "avx2", cpu.X86.HasAVX2 && cpu.X86.HasBMI2},
{count64sse2, "sse2", cpu.X86.HasSSE2},
{count64generic, "generic", true},
}