1
0
mirror of https://github.com/golang/go synced 2024-11-17 00:04:40 -07:00

cmd/compile: combine similar optimization rules on arm64

This CL combines some rules with the same structure.
In order to avoid extremely long rules, this CL does not merge some
rules. In addition, this CL aligned the components of some rules for
better reading.

Change-Id: I4ba1493251ace00b10591e3c8eef4b6277a4b226
Reviewed-on: https://go-review.googlesource.com/c/go/+/476115
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Eric Fang <eric.fang@arm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
erifan01 2023-03-07 08:49:11 +08:00 committed by Eric Fang
parent 10c2348602
commit e81cc9119f
2 changed files with 402 additions and 549 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4219,7 +4219,7 @@ func rewriteValueARM64_OpARM64Equal(v *Value) bool {
return true
}
// match: (Equal (CMPconst [0] z:(MADD a x y)))
// cond: z.Uses==1
// cond: z.Uses == 1
// result: (Equal (CMN a (MUL <x.Type> x y)))
for {
if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
@ -4244,7 +4244,7 @@ func rewriteValueARM64_OpARM64Equal(v *Value) bool {
return true
}
// match: (Equal (CMPconst [0] z:(MSUB a x y)))
// cond: z.Uses==1
// cond: z.Uses == 1
// result: (Equal (CMP a (MUL <x.Type> x y)))
for {
if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
@ -4269,7 +4269,7 @@ func rewriteValueARM64_OpARM64Equal(v *Value) bool {
return true
}
// match: (Equal (CMPWconst [0] z:(MADDW a x y)))
// cond: z.Uses==1
// cond: z.Uses == 1
// result: (Equal (CMNW a (MULW <x.Type> x y)))
for {
if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
@ -4294,7 +4294,7 @@ func rewriteValueARM64_OpARM64Equal(v *Value) bool {
return true
}
// match: (Equal (CMPWconst [0] z:(MSUBW a x y)))
// cond: z.Uses==1
// cond: z.Uses == 1
// result: (Equal (CMPW a (MULW <x.Type> x y)))
for {
if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
@ -17021,7 +17021,7 @@ func rewriteValueARM64_OpARM64NotEqual(v *Value) bool {
return true
}
// match: (NotEqual (CMPconst [0] z:(MADD a x y)))
// cond: z.Uses==1
// cond: z.Uses == 1
// result: (NotEqual (CMN a (MUL <x.Type> x y)))
for {
if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
@ -17046,7 +17046,7 @@ func rewriteValueARM64_OpARM64NotEqual(v *Value) bool {
return true
}
// match: (NotEqual (CMPconst [0] z:(MSUB a x y)))
// cond: z.Uses==1
// cond: z.Uses == 1
// result: (NotEqual (CMP a (MUL <x.Type> x y)))
for {
if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
@ -17071,7 +17071,7 @@ func rewriteValueARM64_OpARM64NotEqual(v *Value) bool {
return true
}
// match: (NotEqual (CMPWconst [0] z:(MADDW a x y)))
// cond: z.Uses==1
// cond: z.Uses == 1
// result: (NotEqual (CMNW a (MULW <x.Type> x y)))
for {
if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
@ -17096,7 +17096,7 @@ func rewriteValueARM64_OpARM64NotEqual(v *Value) bool {
return true
}
// match: (NotEqual (CMPWconst [0] z:(MSUBW a x y)))
// cond: z.Uses==1
// cond: z.Uses == 1
// result: (NotEqual (CMPW a (MULW <x.Type> x y)))
for {
if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {