Source file
src/internal/cpu/goamd64_gen.go
1
2
3
4
5 package cpu
6
7
8
9
10 func appendLevelOptions(options []option, level int32) []option {
11 if level < 2 {
12 options = append(options,
13 option{Name: "popcnt", Feature: &X86.HasPOPCNT},
14 option{Name: "sse3", Feature: &X86.HasSSE3},
15 option{Name: "sse41", Feature: &X86.HasSSE41},
16 option{Name: "sse42", Feature: &X86.HasSSE42},
17 option{Name: "ssse3", Feature: &X86.HasSSSE3},
18 )
19 }
20 if level < 3 {
21 options = append(options,
22 option{Name: "avx", Feature: &X86.HasAVX},
23 option{Name: "avx2", Feature: &X86.HasAVX2},
24 option{Name: "bmi1", Feature: &X86.HasBMI1},
25 option{Name: "bmi2", Feature: &X86.HasBMI2},
26 option{Name: "fma", Feature: &X86.HasFMA},
27 )
28 }
29 if level < 4 {
30 options = append(options,
31 option{Name: "avx512f", Feature: &X86.HasAVX512F},
32 option{Name: "avx512cd", Feature: &X86.HasAVX512CD},
33 option{Name: "avx512bw", Feature: &X86.HasAVX512BW},
34 option{Name: "avx512dq", Feature: &X86.HasAVX512DQ},
35 option{Name: "avx512vl", Feature: &X86.HasAVX512VL},
36 )
37 }
38 return options
39 }
40
View as plain text