Source file src/simd/internal/simd_test/ternary_test.go

     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"
    11  	"testing"
    12  )
    13  
    14  func TestFMA(t *testing.T) {
    15  	if simd.X86.AVX512() {
    16  		testFloat32x4TernaryFlaky(t, simd.Float32x4.MulAdd, fmaSlice[float32], 0.001)
    17  		testFloat32x8TernaryFlaky(t, simd.Float32x8.MulAdd, fmaSlice[float32], 0.001)
    18  		testFloat32x16TernaryFlaky(t, simd.Float32x16.MulAdd, fmaSlice[float32], 0.001)
    19  		testFloat64x2Ternary(t, simd.Float64x2.MulAdd, fmaSlice[float64])
    20  		testFloat64x4Ternary(t, simd.Float64x4.MulAdd, fmaSlice[float64])
    21  		testFloat64x8Ternary(t, simd.Float64x8.MulAdd, fmaSlice[float64])
    22  	}
    23  }
    24  

View as plain text