aboutsummaryrefslogtreecommitdiff
path: root/src/simd/archsimd/_gen
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2025-12-26 11:53:19 -0500
committerCherry Mui <cherryyz@google.com>2025-12-27 09:02:20 -0800
commit037c047f2cb5c962335898c85af2ecef8045027f (patch)
tree9efd1b12db12b8f76d1d7346abb7805da8822078 /src/simd/archsimd/_gen
parent7971fcdf537054608b2443a32f0fbb6dd4eba12a (diff)
downloadgo-037c047f2cb5c962335898c85af2ecef8045027f.tar.xz
simd/archsimd: add more tests for Extend operations
The operations that extend only low elements, ExtendLoNTo..., are not yet included. Change-Id: I93168889b92c56720344b443c1cff238f8cc096a Reviewed-on: https://go-review.googlesource.com/c/go/+/732661 Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/simd/archsimd/_gen')
-rw-r--r--src/simd/archsimd/_gen/tmplgen/main.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/simd/archsimd/_gen/tmplgen/main.go b/src/simd/archsimd/_gen/tmplgen/main.go
index 52ac10af1d..a54d462d01 100644
--- a/src/simd/archsimd/_gen/tmplgen/main.go
+++ b/src/simd/archsimd/_gen/tmplgen/main.go
@@ -372,9 +372,21 @@ func test{{.VType}}ConvertTo{{.OEType}}(t *testing.T, f func(x archsimd.{{.VType
}
`)
-var unaryToInt32 = convertTemplate.target("int", 32)
-var unaryToUint32 = convertTemplate.target("uint", 32)
-var unaryToUint16 = convertTemplate.target("uint", 16)
+var (
+ // templates and shapes for conversion.
+ // TODO: this includes shapes where in and out have the same element type,
+ // which are not needed.
+ unaryToInt8 = convertTemplate.target("int", 8)
+ unaryToUint8 = convertTemplate.target("uint", 8)
+ unaryToInt16 = convertTemplate.target("int", 16)
+ unaryToUint16 = convertTemplate.target("uint", 16)
+ unaryToInt32 = convertTemplate.target("int", 32)
+ unaryToUint32 = convertTemplate.target("uint", 32)
+ unaryToInt64 = convertTemplate.target("int", 64)
+ unaryToUint64 = convertTemplate.target("uint", 64)
+ unaryToFloat32 = convertTemplate.target("float", 32)
+ unaryToFloat64 = convertTemplate.target("float", 64)
+)
var binaryTemplate = templateOf("binary_helpers", `
// test{{.VType}}Binary tests the simd binary method f against the expected behavior generated by want
@@ -862,7 +874,7 @@ func main() {
one(*ush, unsafePrologue, unsafePATemplate)
}
if *uh != "" {
- one(*uh, curryTestPrologue("unary simd methods"), unaryTemplate, unaryToInt32, unaryToUint32, unaryToUint16, unaryFlakyTemplate)
+ one(*uh, curryTestPrologue("unary simd methods"), unaryTemplate, unaryToInt8, unaryToUint8, unaryToInt16, unaryToUint16, unaryToInt32, unaryToUint32, unaryToInt64, unaryToUint64, unaryToFloat32, unaryToFloat64, unaryFlakyTemplate)
}
if *bh != "" {
one(*bh, curryTestPrologue("binary simd methods"), binaryTemplate)