| 1 |
// Copyright 2025 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
//go:build goexperiment.simd && amd64 |
| 6 |
|
| 7 |
package simd_test |
| 8 |
|
| 9 |
import ( |
| 10 |
"simd/archsimd" |
| 11 |
"testing" |
| 12 |
) |
| 13 |
|
| 14 |
func TestFMA(t *testing.T) { |
| 15 |
if archsimd.X86.AVX512() { |
| 16 |
testFloat32x4TernaryFlaky(t, archsimd.Float32x4.MulAdd, fmaSlice[float32], 0.001) |
| 17 |
testFloat32x8TernaryFlaky(t, archsimd.Float32x8.MulAdd, fmaSlice[float32], 0.001) |
| 18 |
testFloat32x16TernaryFlaky(t, archsimd.Float32x16.MulAdd, fmaSlice[float32], 0.001) |
| 19 |
testFloat64x2Ternary(t, archsimd.Float64x2.MulAdd, fmaSlice[float64]) |
| 20 |
testFloat64x4Ternary(t, archsimd.Float64x4.MulAdd, fmaSlice[float64]) |
| 21 |
testFloat64x8Ternary(t, archsimd.Float64x8.MulAdd, fmaSlice[float64]) |
| 22 |
} |
| 23 |
} |