diff options
author | fanzha02 <fannie.zhang@arm.com> | 2020-08-27 17:34:59 +0800 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2020-09-03 14:45:27 +0000 |
commit | ae658cb19a265f3f4694cd4aec508b4565bda6aa (patch) | |
tree | 8c6fdaa2dd0938cb4d0e89e83013031c85f572f9 /src/cmd/compile/internal/ssa/rewrite.go | |
parent | a538b59fd2428ba4d13f296d7483febf2fc05f97 (diff) | |
download | go-ae658cb19a265f3f4694cd4aec508b4565bda6aa.tar.gz go-ae658cb19a265f3f4694cd4aec508b4565bda6aa.zip |
cmd/compile: store the comparison pseudo-ops of arm64 conditional instructions in AuxInt
The current implementation stores the comparison pseudo-ops of arm64
conditional instructions (CSEL/CSEL0) in Aux, this patch modifies it
and stores it in AuxInt, which can avoid the allocation.
Change-Id: I0b69e51f63acd84c6878c6a59ccf6417501a8cfc
Reviewed-on: https://go-review.googlesource.com/c/go/+/252517
Run-TryBot: fannie zhang <Fannie.Zhang@arm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/rewrite.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/rewrite.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go index 3df9ad24f9..09f94ef53e 100644 --- a/src/cmd/compile/internal/ssa/rewrite.go +++ b/src/cmd/compile/internal/ssa/rewrite.go @@ -651,6 +651,10 @@ func auxIntToFlagConstant(x int64) flagConstant { return flagConstant(x) } +func auxIntToOp(cc int64) Op { + return Op(cc) +} + func boolToAuxInt(b bool) int64 { if b { return 1 @@ -694,6 +698,10 @@ func flagConstantToAuxInt(x flagConstant) int64 { return int64(x) } +func opToAuxInt(o Op) int64 { + return int64(o) +} + func auxToString(i interface{}) string { return i.(string) } @@ -727,13 +735,6 @@ func s390xCCMaskToAux(c s390x.CCMask) interface{} { func s390xRotateParamsToAux(r s390x.RotateParams) interface{} { return r } -func cCopToAux(o Op) interface{} { - return o -} - -func auxToCCop(cc interface{}) Op { - return cc.(Op) -} // uaddOvf reports whether unsigned a+b would overflow. func uaddOvf(a, b int64) bool { |