diff options
| author | Junyang Shao <shaojunyang@google.com> | 2025-11-17 21:34:18 +0000 |
|---|---|---|
| committer | Junyang Shao <shaojunyang@google.com> | 2025-11-18 09:02:15 -0800 |
| commit | be9c50c6a02feab53c284e31cb56921b022f2dac (patch) | |
| tree | 447430d63edd9d4f51eb1f7a3d048ca4a599e0ea /src/cmd/compile | |
| parent | 0978935a99a2293aba75db1d7f925109e10ed0a7 (diff) | |
| download | go-be9c50c6a02feab53c284e31cb56921b022f2dac.tar.xz | |
[dev.simd] cmd/compile, simd: change SHA ops names and types
This CL addressed some naming changes decided in API audit.
Before After
SHA1Msg1 SHA1Message1, Remove signed
SHA1Msg2 SHA1Message2, Remove signed
SHA1NextE SHA1NextE, Remove signed
SHA1Round4 SHA1FourRounds, Remove signed
SHA256Msg1 SHA256Message1, Remove signed
SHA256Msg2 SHA256Message2, Remove signed
SHA256Rounds2 SHA256TwoRounds, Remove signed
Change-Id: If2cead113f37a9044bc5c65e78fa9d124e318005
Reviewed-on: https://go-review.googlesource.com/c/go/+/721003
Reviewed-by: David Chase <drchase@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.rules | 19 | ||||
| -rw-r--r-- | src/cmd/compile/internal/ssa/_gen/simdgenericOps.go | 19 | ||||
| -rw-r--r-- | src/cmd/compile/internal/ssa/opGen.go | 67 | ||||
| -rw-r--r-- | src/cmd/compile/internal/ssa/rewriteAMD64.go | 35 | ||||
| -rw-r--r-- | src/cmd/compile/internal/ssagen/simdintrinsics.go | 19 |
5 files changed, 37 insertions, 122 deletions
diff --git a/src/cmd/compile/internal/ssa/_gen/simdAMD64.rules b/src/cmd/compile/internal/ssa/_gen/simdAMD64.rules index ea1094b805..5169bf24d9 100644 --- a/src/cmd/compile/internal/ssa/_gen/simdAMD64.rules +++ b/src/cmd/compile/internal/ssa/_gen/simdAMD64.rules @@ -946,20 +946,13 @@ (RoundToEvenScaledResidueFloat64x2 [a] x) => (VREDUCEPD128 [a+0] x) (RoundToEvenScaledResidueFloat64x4 [a] x) => (VREDUCEPD256 [a+0] x) (RoundToEvenScaledResidueFloat64x8 [a] x) => (VREDUCEPD512 [a+0] x) -(SHA1Msg1Int32x4 ...) => (SHA1MSG1128 ...) -(SHA1Msg1Uint32x4 ...) => (SHA1MSG1128 ...) -(SHA1Msg2Int32x4 ...) => (SHA1MSG2128 ...) -(SHA1Msg2Uint32x4 ...) => (SHA1MSG2128 ...) -(SHA1NextEInt32x4 ...) => (SHA1NEXTE128 ...) +(SHA1FourRoundsUint32x4 ...) => (SHA1RNDS4128 ...) +(SHA1Message1Uint32x4 ...) => (SHA1MSG1128 ...) +(SHA1Message2Uint32x4 ...) => (SHA1MSG2128 ...) (SHA1NextEUint32x4 ...) => (SHA1NEXTE128 ...) -(SHA1Round4Int32x4 ...) => (SHA1RNDS4128 ...) -(SHA1Round4Uint32x4 ...) => (SHA1RNDS4128 ...) -(SHA256Msg1Int32x4 ...) => (SHA256MSG1128 ...) -(SHA256Msg1Uint32x4 ...) => (SHA256MSG1128 ...) -(SHA256Msg2Int32x4 ...) => (SHA256MSG1128 ...) -(SHA256Msg2Uint32x4 ...) => (SHA256MSG1128 ...) -(SHA256Rounds2Int32x4 ...) => (SHA256RNDS2128 ...) -(SHA256Rounds2Uint32x4 ...) => (SHA256RNDS2128 ...) +(SHA256Message1Uint32x4 ...) => (SHA256MSG1128 ...) +(SHA256Message2Uint32x4 ...) => (SHA256MSG1128 ...) +(SHA256TwoRoundsUint32x4 ...) => (SHA256RNDS2128 ...) (ScaleFloat32x4 ...) => (VSCALEFPS128 ...) (ScaleFloat32x8 ...) => (VSCALEFPS256 ...) (ScaleFloat32x16 ...) => (VSCALEFPS512 ...) diff --git a/src/cmd/compile/internal/ssa/_gen/simdgenericOps.go b/src/cmd/compile/internal/ssa/_gen/simdgenericOps.go index b97e5f4f14..dca366f0f9 100644 --- a/src/cmd/compile/internal/ssa/_gen/simdgenericOps.go +++ b/src/cmd/compile/internal/ssa/_gen/simdgenericOps.go @@ -848,18 +848,12 @@ func simdGenericOps() []opData { {name: "RoundToEvenFloat32x8", argLength: 1, commutative: false}, {name: "RoundToEvenFloat64x2", argLength: 1, commutative: false}, {name: "RoundToEvenFloat64x4", argLength: 1, commutative: false}, - {name: "SHA1Msg1Int32x4", argLength: 2, commutative: false}, - {name: "SHA1Msg1Uint32x4", argLength: 2, commutative: false}, - {name: "SHA1Msg2Int32x4", argLength: 2, commutative: false}, - {name: "SHA1Msg2Uint32x4", argLength: 2, commutative: false}, - {name: "SHA1NextEInt32x4", argLength: 2, commutative: false}, + {name: "SHA1Message1Uint32x4", argLength: 2, commutative: false}, + {name: "SHA1Message2Uint32x4", argLength: 2, commutative: false}, {name: "SHA1NextEUint32x4", argLength: 2, commutative: false}, - {name: "SHA256Msg1Int32x4", argLength: 2, commutative: false}, - {name: "SHA256Msg1Uint32x4", argLength: 2, commutative: false}, - {name: "SHA256Msg2Int32x4", argLength: 2, commutative: false}, - {name: "SHA256Msg2Uint32x4", argLength: 2, commutative: false}, - {name: "SHA256Rounds2Int32x4", argLength: 3, commutative: false}, - {name: "SHA256Rounds2Uint32x4", argLength: 3, commutative: false}, + {name: "SHA256Message1Uint32x4", argLength: 2, commutative: false}, + {name: "SHA256Message2Uint32x4", argLength: 2, commutative: false}, + {name: "SHA256TwoRoundsUint32x4", argLength: 3, commutative: false}, {name: "ScaleFloat32x4", argLength: 2, commutative: false}, {name: "ScaleFloat32x8", argLength: 2, commutative: false}, {name: "ScaleFloat32x16", argLength: 2, commutative: false}, @@ -1215,8 +1209,7 @@ func simdGenericOps() []opData { {name: "RoundToEvenScaledResidueFloat64x2", argLength: 1, commutative: false, aux: "UInt8"}, {name: "RoundToEvenScaledResidueFloat64x4", argLength: 1, commutative: false, aux: "UInt8"}, {name: "RoundToEvenScaledResidueFloat64x8", argLength: 1, commutative: false, aux: "UInt8"}, - {name: "SHA1Round4Int32x4", argLength: 2, commutative: false, aux: "UInt8"}, - {name: "SHA1Round4Uint32x4", argLength: 2, commutative: false, aux: "UInt8"}, + {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: "Select128FromPairInt32x8", 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 bd94b4d576..d0482743d1 100644 --- a/src/cmd/compile/internal/ssa/opGen.go +++ b/src/cmd/compile/internal/ssa/opGen.go @@ -6796,18 +6796,12 @@ const ( OpRoundToEvenFloat32x8 OpRoundToEvenFloat64x2 OpRoundToEvenFloat64x4 - OpSHA1Msg1Int32x4 - OpSHA1Msg1Uint32x4 - OpSHA1Msg2Int32x4 - OpSHA1Msg2Uint32x4 - OpSHA1NextEInt32x4 + OpSHA1Message1Uint32x4 + OpSHA1Message2Uint32x4 OpSHA1NextEUint32x4 - OpSHA256Msg1Int32x4 - OpSHA256Msg1Uint32x4 - OpSHA256Msg2Int32x4 - OpSHA256Msg2Uint32x4 - OpSHA256Rounds2Int32x4 - OpSHA256Rounds2Uint32x4 + OpSHA256Message1Uint32x4 + OpSHA256Message2Uint32x4 + OpSHA256TwoRoundsUint32x4 OpScaleFloat32x4 OpScaleFloat32x8 OpScaleFloat32x16 @@ -7163,8 +7157,7 @@ const ( OpRoundToEvenScaledResidueFloat64x2 OpRoundToEvenScaledResidueFloat64x4 OpRoundToEvenScaledResidueFloat64x8 - OpSHA1Round4Int32x4 - OpSHA1Round4Uint32x4 + OpSHA1FourRoundsUint32x4 OpSelect128FromPairFloat32x8 OpSelect128FromPairFloat64x4 OpSelect128FromPairInt32x8 @@ -90254,27 +90247,12 @@ var opcodeTable = [...]opInfo{ generic: true, }, { - name: "SHA1Msg1Int32x4", + name: "SHA1Message1Uint32x4", argLen: 2, generic: true, }, { - name: "SHA1Msg1Uint32x4", - argLen: 2, - generic: true, - }, - { - name: "SHA1Msg2Int32x4", - argLen: 2, - generic: true, - }, - { - name: "SHA1Msg2Uint32x4", - argLen: 2, - generic: true, - }, - { - name: "SHA1NextEInt32x4", + name: "SHA1Message2Uint32x4", argLen: 2, generic: true, }, @@ -90284,32 +90262,17 @@ var opcodeTable = [...]opInfo{ generic: true, }, { - name: "SHA256Msg1Int32x4", + name: "SHA256Message1Uint32x4", argLen: 2, generic: true, }, { - name: "SHA256Msg1Uint32x4", + name: "SHA256Message2Uint32x4", argLen: 2, generic: true, }, { - name: "SHA256Msg2Int32x4", - argLen: 2, - generic: true, - }, - { - name: "SHA256Msg2Uint32x4", - argLen: 2, - generic: true, - }, - { - name: "SHA256Rounds2Int32x4", - argLen: 3, - generic: true, - }, - { - name: "SHA256Rounds2Uint32x4", + name: "SHA256TwoRoundsUint32x4", argLen: 3, generic: true, }, @@ -92215,13 +92178,7 @@ var opcodeTable = [...]opInfo{ generic: true, }, { - name: "SHA1Round4Int32x4", - auxType: auxUInt8, - argLen: 2, - generic: true, - }, - { - name: "SHA1Round4Uint32x4", + name: "SHA1FourRoundsUint32x4", auxType: auxUInt8, argLen: 2, generic: true, diff --git a/src/cmd/compile/internal/ssa/rewriteAMD64.go b/src/cmd/compile/internal/ssa/rewriteAMD64.go index 042649f256..5f564000d9 100644 --- a/src/cmd/compile/internal/ssa/rewriteAMD64.go +++ b/src/cmd/compile/internal/ssa/rewriteAMD64.go @@ -5024,46 +5024,25 @@ func rewriteValueAMD64(v *Value) bool { return rewriteValueAMD64_OpRsh8x64(v) case OpRsh8x8: return rewriteValueAMD64_OpRsh8x8(v) - case OpSHA1Msg1Int32x4: - v.Op = OpAMD64SHA1MSG1128 + case OpSHA1FourRoundsUint32x4: + v.Op = OpAMD64SHA1RNDS4128 return true - case OpSHA1Msg1Uint32x4: + case OpSHA1Message1Uint32x4: v.Op = OpAMD64SHA1MSG1128 return true - case OpSHA1Msg2Int32x4: - v.Op = OpAMD64SHA1MSG2128 - return true - case OpSHA1Msg2Uint32x4: + case OpSHA1Message2Uint32x4: v.Op = OpAMD64SHA1MSG2128 return true - case OpSHA1NextEInt32x4: - v.Op = OpAMD64SHA1NEXTE128 - return true case OpSHA1NextEUint32x4: v.Op = OpAMD64SHA1NEXTE128 return true - case OpSHA1Round4Int32x4: - v.Op = OpAMD64SHA1RNDS4128 - return true - case OpSHA1Round4Uint32x4: - v.Op = OpAMD64SHA1RNDS4128 - return true - case OpSHA256Msg1Int32x4: - v.Op = OpAMD64SHA256MSG1128 - return true - case OpSHA256Msg1Uint32x4: + case OpSHA256Message1Uint32x4: v.Op = OpAMD64SHA256MSG1128 return true - case OpSHA256Msg2Int32x4: + case OpSHA256Message2Uint32x4: v.Op = OpAMD64SHA256MSG1128 return true - case OpSHA256Msg2Uint32x4: - v.Op = OpAMD64SHA256MSG1128 - return true - case OpSHA256Rounds2Int32x4: - v.Op = OpAMD64SHA256RNDS2128 - return true - case OpSHA256Rounds2Uint32x4: + case OpSHA256TwoRoundsUint32x4: v.Op = OpAMD64SHA256RNDS2128 return true case OpScaleFloat32x16: diff --git a/src/cmd/compile/internal/ssagen/simdintrinsics.go b/src/cmd/compile/internal/ssagen/simdintrinsics.go index f3aa904f6c..492f581781 100644 --- a/src/cmd/compile/internal/ssagen/simdintrinsics.go +++ b/src/cmd/compile/internal/ssagen/simdintrinsics.go @@ -958,20 +958,13 @@ func simdIntrinsics(addF func(pkg, fn string, b intrinsicBuilder, archFamilies . addF(simdPackage, "Float64x2.RoundToEvenScaledResidue", opLen1Imm8(ssa.OpRoundToEvenScaledResidueFloat64x2, types.TypeVec128, 4), sys.AMD64) addF(simdPackage, "Float64x4.RoundToEvenScaledResidue", opLen1Imm8(ssa.OpRoundToEvenScaledResidueFloat64x4, types.TypeVec256, 4), sys.AMD64) addF(simdPackage, "Float64x8.RoundToEvenScaledResidue", opLen1Imm8(ssa.OpRoundToEvenScaledResidueFloat64x8, types.TypeVec512, 4), sys.AMD64) - addF(simdPackage, "Int32x4.SHA1Msg1", opLen2(ssa.OpSHA1Msg1Int32x4, types.TypeVec128), sys.AMD64) - addF(simdPackage, "Uint32x4.SHA1Msg1", opLen2(ssa.OpSHA1Msg1Uint32x4, types.TypeVec128), sys.AMD64) - addF(simdPackage, "Int32x4.SHA1Msg2", opLen2(ssa.OpSHA1Msg2Int32x4, types.TypeVec128), sys.AMD64) - addF(simdPackage, "Uint32x4.SHA1Msg2", opLen2(ssa.OpSHA1Msg2Uint32x4, types.TypeVec128), sys.AMD64) - addF(simdPackage, "Int32x4.SHA1NextE", opLen2(ssa.OpSHA1NextEInt32x4, types.TypeVec128), sys.AMD64) + addF(simdPackage, "Uint32x4.SHA1FourRounds", opLen2Imm8_SHA1RNDS4(ssa.OpSHA1FourRoundsUint32x4, types.TypeVec128, 0), sys.AMD64) + addF(simdPackage, "Uint32x4.SHA1Message1", opLen2(ssa.OpSHA1Message1Uint32x4, types.TypeVec128), sys.AMD64) + addF(simdPackage, "Uint32x4.SHA1Message2", opLen2(ssa.OpSHA1Message2Uint32x4, types.TypeVec128), sys.AMD64) addF(simdPackage, "Uint32x4.SHA1NextE", opLen2(ssa.OpSHA1NextEUint32x4, types.TypeVec128), sys.AMD64) - addF(simdPackage, "Int32x4.SHA1Round4", opLen2Imm8_SHA1RNDS4(ssa.OpSHA1Round4Int32x4, types.TypeVec128, 0), sys.AMD64) - addF(simdPackage, "Uint32x4.SHA1Round4", opLen2Imm8_SHA1RNDS4(ssa.OpSHA1Round4Uint32x4, types.TypeVec128, 0), sys.AMD64) - addF(simdPackage, "Int32x4.SHA256Msg1", opLen2(ssa.OpSHA256Msg1Int32x4, types.TypeVec128), sys.AMD64) - addF(simdPackage, "Uint32x4.SHA256Msg1", opLen2(ssa.OpSHA256Msg1Uint32x4, types.TypeVec128), sys.AMD64) - addF(simdPackage, "Int32x4.SHA256Msg2", opLen2(ssa.OpSHA256Msg2Int32x4, types.TypeVec128), sys.AMD64) - addF(simdPackage, "Uint32x4.SHA256Msg2", opLen2(ssa.OpSHA256Msg2Uint32x4, types.TypeVec128), sys.AMD64) - addF(simdPackage, "Int32x4.SHA256Rounds2", opLen3(ssa.OpSHA256Rounds2Int32x4, types.TypeVec128), sys.AMD64) - addF(simdPackage, "Uint32x4.SHA256Rounds2", opLen3(ssa.OpSHA256Rounds2Uint32x4, types.TypeVec128), sys.AMD64) + addF(simdPackage, "Uint32x4.SHA256Message1", opLen2(ssa.OpSHA256Message1Uint32x4, types.TypeVec128), sys.AMD64) + addF(simdPackage, "Uint32x4.SHA256Message2", opLen2(ssa.OpSHA256Message2Uint32x4, types.TypeVec128), sys.AMD64) + addF(simdPackage, "Uint32x4.SHA256TwoRounds", opLen3(ssa.OpSHA256TwoRoundsUint32x4, types.TypeVec128), sys.AMD64) addF(simdPackage, "Float32x4.Scale", opLen2(ssa.OpScaleFloat32x4, types.TypeVec128), sys.AMD64) addF(simdPackage, "Float32x8.Scale", opLen2(ssa.OpScaleFloat32x8, types.TypeVec256), sys.AMD64) addF(simdPackage, "Float32x16.Scale", opLen2(ssa.OpScaleFloat32x16, types.TypeVec512), sys.AMD64) |
