cmd/compile: convert typed aux to CCop for ARM64 rules

Add a new conversion function to convert aux type to Op type.

Passes toolstash-check -all.

Change-Id: I25d649a5296f6f178d64320dfc5d291e0a597e24
Reviewed-on: https://go-review.googlesource.com/c/go/+/233739
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
fanzha02 2020-05-12 19:47:23 +08:00 committed by fannie zhang
parent 328214e85c
commit ffbd8524ac
3 changed files with 119 additions and 116 deletions

View file

@ -705,6 +705,10 @@ 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 {
return uint64(a)+uint64(b) < uint64(a)
@ -1008,8 +1012,7 @@ func arm64Invert(op Op) Op {
// evaluate an ARM64 op against a flags value
// that is potentially constant; return 1 for true,
// -1 for false, and 0 for not constant.
func ccARM64Eval(cc interface{}, flags *Value) int {
op := cc.(Op)
func ccARM64Eval(op Op, flags *Value) int {
fop := flags.Op
if fop == OpARM64InvertFlags {
return -ccARM64Eval(op, flags.Args[0])