aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2025-11-19 17:17:54 -0500
committerDavid Chase <drchase@google.com>2025-11-20 17:48:29 -0800
commit74ebdd28d10f93fbcb58708c76b5805bc6c114a3 (patch)
tree6d64d39b6995ba457bc1b986099ea679c34fade7 /src/cmd/compile
parent4d26d66a49c51b5a7c610c4815322809b31962d9 (diff)
downloadgo-74ebdd28d10f93fbcb58708c76b5805bc6c114a3.tar.xz
[dev.simd] simd, cmd/compile: add more element types for Select128FromPair
Also includes a comment cleanup pass. Fixed NAME processing for additional documentation. Change-Id: Ide5b60c17ddbf3c6eafd20147981c59493fc8133 Reviewed-on: https://go-review.googlesource.com/c/go/+/722180 Reviewed-by: Junyang Shao <shaojunyang@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/compile')
-rw-r--r--src/cmd/compile/internal/ssa/_gen/simdAMD64.rules4
-rw-r--r--src/cmd/compile/internal/ssa/_gen/simdgenericOps.go4
-rw-r--r--src/cmd/compile/internal/ssa/opGen.go28
-rw-r--r--src/cmd/compile/internal/ssa/rewriteAMD64.go12
-rw-r--r--src/cmd/compile/internal/ssagen/simdintrinsics.go4
5 files changed, 52 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/_gen/simdAMD64.rules b/src/cmd/compile/internal/ssa/_gen/simdAMD64.rules
index 283a2e53cd..db426f6615 100644
--- a/src/cmd/compile/internal/ssa/_gen/simdAMD64.rules
+++ b/src/cmd/compile/internal/ssa/_gen/simdAMD64.rules
@@ -941,8 +941,12 @@
(ScaleFloat64x8 ...) => (VSCALEFPD512 ...)
(Select128FromPairFloat32x8 ...) => (VPERM2F128256 ...)
(Select128FromPairFloat64x4 ...) => (VPERM2F128256 ...)
+(Select128FromPairInt8x32 ...) => (VPERM2I128256 ...)
+(Select128FromPairInt16x16 ...) => (VPERM2I128256 ...)
(Select128FromPairInt32x8 ...) => (VPERM2I128256 ...)
(Select128FromPairInt64x4 ...) => (VPERM2I128256 ...)
+(Select128FromPairUint8x32 ...) => (VPERM2I128256 ...)
+(Select128FromPairUint16x16 ...) => (VPERM2I128256 ...)
(Select128FromPairUint32x8 ...) => (VPERM2I128256 ...)
(Select128FromPairUint64x4 ...) => (VPERM2I128256 ...)
(SetElemFloat32x4 ...) => (VPINSRD128 ...)
diff --git a/src/cmd/compile/internal/ssa/_gen/simdgenericOps.go b/src/cmd/compile/internal/ssa/_gen/simdgenericOps.go
index 3fae158c0a..5683fcef0d 100644
--- a/src/cmd/compile/internal/ssa/_gen/simdgenericOps.go
+++ b/src/cmd/compile/internal/ssa/_gen/simdgenericOps.go
@@ -1192,8 +1192,12 @@ func simdGenericOps() []opData {
{name: "SHA1FourRoundsUint32x4", argLength: 2, commutative: false, aux: "UInt8"},
{name: "Select128FromPairFloat32x8", argLength: 2, commutative: false, aux: "UInt8"},
{name: "Select128FromPairFloat64x4", argLength: 2, commutative: false, aux: "UInt8"},
+ {name: "Select128FromPairInt8x32", argLength: 2, commutative: false, aux: "UInt8"},
+ {name: "Select128FromPairInt16x16", argLength: 2, commutative: false, aux: "UInt8"},
{name: "Select128FromPairInt32x8", argLength: 2, commutative: false, aux: "UInt8"},
{name: "Select128FromPairInt64x4", argLength: 2, commutative: false, aux: "UInt8"},
+ {name: "Select128FromPairUint8x32", argLength: 2, commutative: false, aux: "UInt8"},
+ {name: "Select128FromPairUint16x16", argLength: 2, commutative: false, aux: "UInt8"},
{name: "Select128FromPairUint32x8", argLength: 2, commutative: false, aux: "UInt8"},
{name: "Select128FromPairUint64x4", argLength: 2, commutative: false, aux: "UInt8"},
{name: "SetElemFloat32x4", argLength: 2, commutative: false, aux: "UInt8"},
diff --git a/src/cmd/compile/internal/ssa/opGen.go b/src/cmd/compile/internal/ssa/opGen.go
index fa94dfbbd5..bb40ff4117 100644
--- a/src/cmd/compile/internal/ssa/opGen.go
+++ b/src/cmd/compile/internal/ssa/opGen.go
@@ -7151,8 +7151,12 @@ const (
OpSHA1FourRoundsUint32x4
OpSelect128FromPairFloat32x8
OpSelect128FromPairFloat64x4
+ OpSelect128FromPairInt8x32
+ OpSelect128FromPairInt16x16
OpSelect128FromPairInt32x8
OpSelect128FromPairInt64x4
+ OpSelect128FromPairUint8x32
+ OpSelect128FromPairUint16x16
OpSelect128FromPairUint32x8
OpSelect128FromPairUint64x4
OpSetElemFloat32x4
@@ -92251,6 +92255,18 @@ var opcodeTable = [...]opInfo{
generic: true,
},
{
+ name: "Select128FromPairInt8x32",
+ auxType: auxUInt8,
+ argLen: 2,
+ generic: true,
+ },
+ {
+ name: "Select128FromPairInt16x16",
+ auxType: auxUInt8,
+ argLen: 2,
+ generic: true,
+ },
+ {
name: "Select128FromPairInt32x8",
auxType: auxUInt8,
argLen: 2,
@@ -92263,6 +92279,18 @@ var opcodeTable = [...]opInfo{
generic: true,
},
{
+ name: "Select128FromPairUint8x32",
+ auxType: auxUInt8,
+ argLen: 2,
+ generic: true,
+ },
+ {
+ name: "Select128FromPairUint16x16",
+ auxType: auxUInt8,
+ argLen: 2,
+ generic: true,
+ },
+ {
name: "Select128FromPairUint32x8",
auxType: auxUInt8,
argLen: 2,
diff --git a/src/cmd/compile/internal/ssa/rewriteAMD64.go b/src/cmd/compile/internal/ssa/rewriteAMD64.go
index 5ad2ed3f96..c7995c5c9e 100644
--- a/src/cmd/compile/internal/ssa/rewriteAMD64.go
+++ b/src/cmd/compile/internal/ssa/rewriteAMD64.go
@@ -5017,18 +5017,30 @@ func rewriteValueAMD64(v *Value) bool {
case OpSelect128FromPairFloat64x4:
v.Op = OpAMD64VPERM2F128256
return true
+ case OpSelect128FromPairInt16x16:
+ v.Op = OpAMD64VPERM2I128256
+ return true
case OpSelect128FromPairInt32x8:
v.Op = OpAMD64VPERM2I128256
return true
case OpSelect128FromPairInt64x4:
v.Op = OpAMD64VPERM2I128256
return true
+ case OpSelect128FromPairInt8x32:
+ v.Op = OpAMD64VPERM2I128256
+ return true
+ case OpSelect128FromPairUint16x16:
+ v.Op = OpAMD64VPERM2I128256
+ return true
case OpSelect128FromPairUint32x8:
v.Op = OpAMD64VPERM2I128256
return true
case OpSelect128FromPairUint64x4:
v.Op = OpAMD64VPERM2I128256
return true
+ case OpSelect128FromPairUint8x32:
+ v.Op = OpAMD64VPERM2I128256
+ return true
case OpSelectN:
return rewriteValueAMD64_OpSelectN(v)
case OpSetElemFloat32x4:
diff --git a/src/cmd/compile/internal/ssagen/simdintrinsics.go b/src/cmd/compile/internal/ssagen/simdintrinsics.go
index 34e491371e..413cf92c88 100644
--- a/src/cmd/compile/internal/ssagen/simdintrinsics.go
+++ b/src/cmd/compile/internal/ssagen/simdintrinsics.go
@@ -953,8 +953,12 @@ func simdIntrinsics(addF func(pkg, fn string, b intrinsicBuilder, archFamilies .
addF(simdPackage, "Float64x8.Scale", opLen2(ssa.OpScaleFloat64x8, types.TypeVec512), sys.AMD64)
addF(simdPackage, "Float32x8.Select128FromPair", opLen2Imm8_II(ssa.OpSelect128FromPairFloat32x8, types.TypeVec256, 0), sys.AMD64)
addF(simdPackage, "Float64x4.Select128FromPair", opLen2Imm8_II(ssa.OpSelect128FromPairFloat64x4, types.TypeVec256, 0), sys.AMD64)
+ addF(simdPackage, "Int8x32.Select128FromPair", opLen2Imm8_II(ssa.OpSelect128FromPairInt8x32, types.TypeVec256, 0), sys.AMD64)
+ addF(simdPackage, "Int16x16.Select128FromPair", opLen2Imm8_II(ssa.OpSelect128FromPairInt16x16, types.TypeVec256, 0), sys.AMD64)
addF(simdPackage, "Int32x8.Select128FromPair", opLen2Imm8_II(ssa.OpSelect128FromPairInt32x8, types.TypeVec256, 0), sys.AMD64)
addF(simdPackage, "Int64x4.Select128FromPair", opLen2Imm8_II(ssa.OpSelect128FromPairInt64x4, types.TypeVec256, 0), sys.AMD64)
+ addF(simdPackage, "Uint8x32.Select128FromPair", opLen2Imm8_II(ssa.OpSelect128FromPairUint8x32, types.TypeVec256, 0), sys.AMD64)
+ addF(simdPackage, "Uint16x16.Select128FromPair", opLen2Imm8_II(ssa.OpSelect128FromPairUint16x16, types.TypeVec256, 0), sys.AMD64)
addF(simdPackage, "Uint32x8.Select128FromPair", opLen2Imm8_II(ssa.OpSelect128FromPairUint32x8, types.TypeVec256, 0), sys.AMD64)
addF(simdPackage, "Uint64x4.Select128FromPair", opLen2Imm8_II(ssa.OpSelect128FromPairUint64x4, types.TypeVec256, 0), sys.AMD64)
addF(simdPackage, "Float32x4.SetElem", opLen2Imm8(ssa.OpSetElemFloat32x4, types.TypeVec128, 0), sys.AMD64)