cmd/compile/internal/ssa: split helpers
We're going to move the rewrites to their own packages in the
next CL. To do that we're going to move the helpers out
of the ssacompile package. Helpers used by multiple
packages have been exported and will be relocated to the ssa package,
while helpers only used by one of the rewrites will be
left unexported and moved to a dedicated file that will
be moved in the next CL along with the actual rewrites.
For #80409
[git-generate]
cd src/cmd/compile/internal/ssacompile
rf 'mv Sdivisible SdivisibleData SdivisibleOK SdivisibleOK16 SdivisibleOK8 Smagic SmagicData SmagicOK Udivisible UdivisibleData UdivisibleOK UdivisibleOK16 UdivisibleOK8 Umagic UmagicData ../ssa/magic.go'
# Move the helpers to the ssa package.
rf '
mv AddFlags32 AddFlags64 Arm64BitFieldToAuxInt \
Arm64ConditionalParamsToAuxInt \
ArmBFAuxInt AuxIntToArm64BitField AuxIntToBool \
AuxIntToFlagConstant AuxIntToFloat32 AuxIntToFloat64 \
AuxIntToInt16 AuxIntToInt32 AuxIntToInt64 AuxIntToInt8 \
AuxIntToOp AuxIntToUint64 \
AuxIntToUint8 AuxIntToValAndOff AuxToCall AuxToPanicBoundsC \
AuxToPanicBoundsCC AuxToS390xCCMask AuxToS390xRotateParams \
AuxToString AuxToSym AuxToType B2i B2i32 CallToAux \
CanMergeLoad \
CanMergeLoadClobber \
CanMergeSym CanMulStrengthReduce CanMulStrengthReduce32 \
CanonLessThan Clobber ClobberIfDead CountRule \
DeadValueChoice EncodePPC64RotateMask \
FlagArg FlagConstantBuilder FlagConstantToAuxInt \
Float32ToAuxInt Float64ToAuxInt ImakeOfStructMake \
Int16ToAuxInt Int32ToAuxInt Int64ToAuxInt Int8ToAuxInt \
Is12Bit Is16Bit Is16BitInt Is20Bit Is32Bit Is32BitFloat \
Is32BitInt Is64BitFloat Is64BitInt Is8BitInt IsPowerOfTwo \
IsPPC64ValidShiftMask IsPPC64WordRotateMask IsPtr IsSameCall \
IsU32Bit IsVolatile LeaveDeadValues \
Log16 Log16u Log32 Log32u Log64 Log64u Log8u \
LogicFlags32 LogicFlags64 LogLargeCopyValue LogRule \
MakeJumpTableSym \
MergePPC64AndSrwi MergePPC64ClrlsldiRlwinm \
MergePPC64ClrlsldiSrw MergePPC64RShiftMask MergePPC64SldiSrw \
MergeSym ModularMultiplicativeInverse MoveSize \
MulStrengthReduce MulStrengthReduce32 NewPPC64ShiftAuxInt \
NoteRule Ntz64 OneBit OpToAuxInt PanicBoundsCCToAux \
PanicBoundsCToAux \
Read16 \
Read32 Read64 Read8 RemoveDeadValues RepMoveThreshold \
RepZeroThreshold RewriteStructStore S390xCCMaskToAux \
S390xRotateParamsToAux SetPos ShiftIsBounded \
SubFlags32 SubFlags64 SupportsPPC64PCRel SymIsRO SymToAux \
TypeToAux Uint64ToAuxInt Uint8ToAuxInt ValAndOffToAuxInt \
ruleFile \
../ssa/rewrite.go'
# Update the generator and the rules files.
cd ../ssa/_gen
rf 'sub splitPhase var splitPhase = phase5Conv'
sed -i \
-e 's/\bAddFlags32(/ssa.AddFlags32(/g' \
-e 's/\bAddFlags64(/ssa.AddFlags64(/g' \
-e 's/\bArmBFAuxInt(/ssa.ArmBFAuxInt(/g' \
-e 's/\bB2i(/ssa.B2i(/g' \
-e 's/\bB2i32(/ssa.B2i32(/g' \
-e 's/\bCanMergeLoad(/ssa.CanMergeLoad(/g' \
-e 's/\bCanMergeLoadClobber(/ssa.CanMergeLoadClobber(/g' \
-e 's/\bCanMergeSym(/ssa.CanMergeSym(/g' \
-e 's/\bCanMulStrengthReduce(/ssa.CanMulStrengthReduce(/g' \
-e 's/\bCanMulStrengthReduce32(/ssa.CanMulStrengthReduce32(/g' \
-e 's/\bCanonLessThan(/ssa.CanonLessThan(/g' \
-e 's/\bClobber(/ssa.Clobber(/g' \
-e 's/\bClobberIfDead(/ssa.ClobberIfDead(/g' \
-e 's/\bEncodePPC64RotateMask(/ssa.EncodePPC64RotateMask(/g' \
-e 's/\bFlagArg(/ssa.FlagArg(/g' \
-e 's/\bImakeOfStructMake(/ssa.ImakeOfStructMake(/g' \
-e 's/\bIs12Bit(/ssa.Is12Bit(/g' \
-e 's/\bIs16Bit(/ssa.Is16Bit(/g' \
-e 's/\bIs16BitInt(/ssa.Is16BitInt(/g' \
-e 's/\bIs20Bit(/ssa.Is20Bit(/g' \
-e 's/\bIs32Bit(/ssa.Is32Bit(/g' \
-e 's/\bIs32BitFloat(/ssa.Is32BitFloat(/g' \
-e 's/\bIs32BitInt(/ssa.Is32BitInt(/g' \
-e 's/\bIs64BitFloat(/ssa.Is64BitFloat(/g' \
-e 's/\bIs64BitInt(/ssa.Is64BitInt(/g' \
-e 's/\bIs8BitInt(/ssa.Is8BitInt(/g' \
-e 's/\bIsPowerOfTwo(/ssa.IsPowerOfTwo(/g' \
-e 's/\bIsPPC64ValidShiftMask(/ssa.IsPPC64ValidShiftMask(/g' \
-e 's/\bIsPPC64WordRotateMask(/ssa.IsPPC64WordRotateMask(/g' \
-e 's/[^.a-z]IsPtr(/ssa.IsPtr(/g' \
-e 's/\bIsSameCall(/ssa.IsSameCall(/g' \
-e 's/\bIsU32Bit(/ssa.IsU32Bit(/g' \
-e 's/\bIsVolatile(/ssa.IsVolatile(/g' \
-e 's/\bLog16(/ssa.Log16(/g' \
-e 's/\bLog16u(/ssa.Log16u(/g' \
-e 's/\bLog32(/ssa.Log32(/g' \
-e 's/\bLog32u(/ssa.Log32u(/g' \
-e 's/\bLog64(/ssa.Log64(/g' \
-e 's/\bLog64u(/ssa.Log64u(/g' \
-e 's/\bLog8u(/ssa.Log8u(/g' \
-e 's/\bLogicFlags32(/ssa.LogicFlags32(/g' \
-e 's/\bLogicFlags64(/ssa.LogicFlags64(/g' \
-e 's/\bLogLargeCopyValue(/ssa.LogLargeCopyValue(/g' \
-e 's/\bMakeJumpTableSym(/ssa.MakeJumpTableSym(/g' \
-e 's/\bMergePPC64AndSrwi(/ssa.MergePPC64AndSrwi(/g' \
-e 's/\bMergePPC64ClrlsldiRlwinm(/ssa.MergePPC64ClrlsldiRlwinm(/g' \
-e 's/\bMergePPC64ClrlsldiSrw(/ssa.MergePPC64ClrlsldiSrw(/g' \
-e 's/\bMergePPC64RShiftMask(/ssa.MergePPC64RShiftMask(/g' \
-e 's/\bMergePPC64SldiSrw(/ssa.MergePPC64SldiSrw(/g' \
-e 's/\bMergeSym(/ssa.MergeSym(/g' \
-e 's/\bModularMultiplicativeInverse(/ssa.ModularMultiplicativeInverse(/g' \
-e 's/\bMoveSize(/ssa.MoveSize(/g' \
-e 's/\bMulStrengthReduce(/ssa.MulStrengthReduce(/g' \
-e 's/\bMulStrengthReduce32(/ssa.MulStrengthReduce32(/g' \
-e 's/\bNewPPC64ShiftAuxInt(/ssa.NewPPC64ShiftAuxInt(/g' \
-e 's/\bNtz64(/ssa.Ntz64(/g' \
-e 's/\bOneBit(/ssa.OneBit(/g' \
-e 's/\bRead16(/ssa.Read16(/g' \
-e 's/\bRead32(/ssa.Read32(/g' \
-e 's/\bRead64(/ssa.Read64(/g' \
-e 's/\bRead8(/ssa.Read8(/g' \
-e 's/\bRepMoveThreshold\b/ssa.RepMoveThreshold/g' \
-e 's/\bRepZeroThreshold\b/ssa.RepZeroThreshold/g' \
-e 's/\bRewriteStructStore(/ssa.RewriteStructStore(/g' \
-e 's/\bSdivisibleOK16(/ssa.SdivisibleOK16(/g' \
-e 's/\bSdivisibleOK8(/ssa.SdivisibleOK8(/g' \
-e 's/\bSetPos(/ssa.SetPos(/g' \
-e 's/\bShiftIsBounded(/ssa.ShiftIsBounded(/g' \
-e 's/\bSubFlags32(/ssa.SubFlags32(/g' \
-e 's/\bSubFlags64(/ssa.SubFlags64(/g' \
-e 's/\bSupportsPPC64PCRel(/ssa.SupportsPPC64PCRel(/g' \
-e 's/\bSymIsRO(/ssa.SymIsRO(/g' \
-e 's/\bUdivisibleOK16(/ssa.UdivisibleOK16(/g' \
-e 's/\bUdivisibleOK8(/ssa.UdivisibleOK8(/g' \
*.rules
cd ../../../../../simd/archsimd/_gen
sed -i 's/^var splitPhase = .*$/var splitPhase = phase5Conv/' \
simdgen/main.go wasmgen/main.go tmplgen/main.go
go run . -tmplgen -simdgen -wasmgen
Change-Id: I64c81400716c1803f8f803c12c14e4146a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/808741
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 4.0 Attribution license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.