Source file
src/simd/midway_amd64_test.go
1
2
3
4
5
6
7 package simd
8
9 import (
10 "internal/cpu"
11 "simd/archsimd"
12 "testing"
13 )
14
15 func TestAMD64WithoutFMA(t *testing.T) {
16 if !archsimd.X86.AVX() {
17 t.Skip("requires AVX")
18 }
19 saved := cpu.X86.HasFMA
20 cpu.X86.HasFMA = false
21 defer func() { cpu.X86.HasFMA = saved }()
22 if archsimd.X86.FMA() {
23 t.Skip("FMA is guaranteed by GOAMD64")
24 }
25
26 for _, gosimd := range []string{"", "1", "128", "256", "512"} {
27 if _, emulated := configure(archMaxVectorSize(), gosimd); !emulated {
28 t.Errorf("hardware SIMD selected without FMA with GODEBUG=simd=%s", gosimd)
29 }
30 }
31 }
32
View as plain text