-
Notifications
You must be signed in to change notification settings - Fork 6
/
select_amd64.go
49 lines (39 loc) · 1.6 KB
/
select_amd64.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
42
43
44
45
46
47
48
49
// Copyright (c) 2020 Robert Clausecker <[email protected]>
package pospop
import "golang.org/x/sys/cpu"
func count8avx512(counts *[8]int, buf []byte)
func count8avx2(counts *[8]int, buf []byte)
func count8sse2(counts *[8]int, buf []byte)
func count16avx512(counts *[16]int, buf []uint16)
func count16avx2(counts *[16]int, buf []uint16)
func count16sse2(counts *[16]int, buf []uint16)
func count32avx512(counts *[32]int, buf []uint32)
func count32avx2(counts *[32]int, buf []uint32)
func count32sse2(counts *[32]int, buf []uint32)
func count64avx512(counts *[64]int, buf []uint64)
func count64avx2(counts *[64]int, buf []uint64)
func count64sse2(counts *[64]int, buf []uint64)
var count8funcs = []count8impl{
{count8avx512, "avx512", cpu.X86.HasBMI2 && cpu.X86.HasAVX512BW},
{count8avx2, "avx2", cpu.X86.HasBMI2 && cpu.X86.HasAVX2},
{count8sse2, "sse2", cpu.X86.HasSSE2},
{count8generic, "generic", true},
}
var count16funcs = []count16impl{
{count16avx512, "avx512", cpu.X86.HasBMI2 && cpu.X86.HasAVX512BW},
{count16avx2, "avx2", cpu.X86.HasBMI2 && cpu.X86.HasAVX2},
{count16sse2, "sse2", cpu.X86.HasSSE2},
{count16generic, "generic", true},
}
var count32funcs = []count32impl{
{count32avx512, "avx512", cpu.X86.HasBMI2 && cpu.X86.HasAVX512BW},
{count32avx2, "avx2", cpu.X86.HasBMI2 && cpu.X86.HasAVX2},
{count32sse2, "sse2", cpu.X86.HasSSE2},
{count32generic, "generic", true},
}
var count64funcs = []count64impl{
{count64avx512, "avx512", cpu.X86.HasBMI2 && cpu.X86.HasAVX512BW},
{count64avx2, "avx2", cpu.X86.HasBMI2 && cpu.X86.HasAVX2},
{count64sse2, "sse2", cpu.X86.HasSSE2},
{count64generic, "generic", true},
}