diff options
author | Alberto Donizetti <alb.donizetti@gmail.com> | 2020-04-30 11:04:02 +0200 |
---|---|---|
committer | Alberto Donizetti <alb.donizetti@gmail.com> | 2020-04-30 17:30:54 +0000 |
commit | 666c9aedd40853e2fc84bbd743b13cb267007ac2 (patch) | |
tree | 43bc80fcf6ac0fa490a69c770ec58996f45032de /src/cmd/compile/internal/ssa/rewriteARM64.go | |
parent | 9ed0fb42e34ff64dd6447572d8bc9dbb05ddb552 (diff) | |
download | go-666c9aedd40853e2fc84bbd743b13cb267007ac2.tar.gz go-666c9aedd40853e2fc84bbd743b13cb267007ac2.zip |
cmd/compile: switch to typed auxint for arm64 TBZ/TBNZ block
This CL changes the arm64 TBZ/TBNZ block from using Aux to using
a (typed) AuxInt. The corresponding rules have also been changed
to be typed.
Passes
GOARCH=arm64 gotip build -toolexec 'toolstash -cmp' -a std
Change-Id: I98d0cd2a791948f1db13259c17fb1b9b2807a043
Reviewed-on: https://go-review.googlesource.com/c/go/+/230839
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/rewriteARM64.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/rewriteARM64.go | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/src/cmd/compile/internal/ssa/rewriteARM64.go b/src/cmd/compile/internal/ssa/rewriteARM64.go index d6cfb0eea4..e820c2438c 100644 --- a/src/cmd/compile/internal/ssa/rewriteARM64.go +++ b/src/cmd/compile/internal/ssa/rewriteARM64.go @@ -26071,30 +26071,30 @@ func rewriteBlockARM64(b *Block) bool { } // match: (EQ (TSTconst [c] x) yes no) // cond: oneBit(c) - // result: (TBZ {int64(ntz64(c))} x yes no) + // result: (TBZ [int64(ntz64(c))] x yes no) for b.Controls[0].Op == OpARM64TSTconst { v_0 := b.Controls[0] - c := v_0.AuxInt + c := auxIntToInt64(v_0.AuxInt) x := v_0.Args[0] if !(oneBit(c)) { break } b.resetWithControl(BlockARM64TBZ, x) - b.Aux = int64(ntz64(c)) + b.AuxInt = int64ToAuxInt(int64(ntz64(c))) return true } // match: (EQ (TSTWconst [c] x) yes no) // cond: oneBit(int64(uint32(c))) - // result: (TBZ {int64(ntz64(int64(uint32(c))))} x yes no) + // result: (TBZ [int64(ntz64(int64(uint32(c))))] x yes no) for b.Controls[0].Op == OpARM64TSTWconst { v_0 := b.Controls[0] - c := v_0.AuxInt + c := auxIntToInt32(v_0.AuxInt) x := v_0.Args[0] if !(oneBit(int64(uint32(c)))) { break } b.resetWithControl(BlockARM64TBZ, x) - b.Aux = int64(ntz64(int64(uint32(c)))) + b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c))))) return true } // match: (EQ (FlagEQ) yes no) @@ -26521,27 +26521,27 @@ func rewriteBlockARM64(b *Block) bool { return true } // match: (GE (CMPWconst [0] x) yes no) - // result: (TBZ {int64(31)} x yes no) + // result: (TBZ [31] x yes no) for b.Controls[0].Op == OpARM64CMPWconst { v_0 := b.Controls[0] - if v_0.AuxInt != 0 { + if auxIntToInt32(v_0.AuxInt) != 0 { break } x := v_0.Args[0] b.resetWithControl(BlockARM64TBZ, x) - b.Aux = int64(31) + b.AuxInt = int64ToAuxInt(31) return true } // match: (GE (CMPconst [0] x) yes no) - // result: (TBZ {int64(63)} x yes no) + // result: (TBZ [63] x yes no) for b.Controls[0].Op == OpARM64CMPconst { v_0 := b.Controls[0] - if v_0.AuxInt != 0 { + if auxIntToInt64(v_0.AuxInt) != 0 { break } x := v_0.Args[0] b.resetWithControl(BlockARM64TBZ, x) - b.Aux = int64(63) + b.AuxInt = int64ToAuxInt(63) return true } // match: (GE (FlagEQ) yes no) @@ -27821,27 +27821,27 @@ func rewriteBlockARM64(b *Block) bool { return true } // match: (LT (CMPWconst [0] x) yes no) - // result: (TBNZ {int64(31)} x yes no) + // result: (TBNZ [31] x yes no) for b.Controls[0].Op == OpARM64CMPWconst { v_0 := b.Controls[0] - if v_0.AuxInt != 0 { + if auxIntToInt32(v_0.AuxInt) != 0 { break } x := v_0.Args[0] b.resetWithControl(BlockARM64TBNZ, x) - b.Aux = int64(31) + b.AuxInt = int64ToAuxInt(31) return true } // match: (LT (CMPconst [0] x) yes no) - // result: (TBNZ {int64(63)} x yes no) + // result: (TBNZ [63] x yes no) for b.Controls[0].Op == OpARM64CMPconst { v_0 := b.Controls[0] - if v_0.AuxInt != 0 { + if auxIntToInt64(v_0.AuxInt) != 0 { break } x := v_0.Args[0] b.resetWithControl(BlockARM64TBNZ, x) - b.Aux = int64(63) + b.AuxInt = int64ToAuxInt(63) return true } // match: (LT (FlagEQ) yes no) @@ -28254,30 +28254,30 @@ func rewriteBlockARM64(b *Block) bool { } // match: (NE (TSTconst [c] x) yes no) // cond: oneBit(c) - // result: (TBNZ {int64(ntz64(c))} x yes no) + // result: (TBNZ [int64(ntz64(c))] x yes no) for b.Controls[0].Op == OpARM64TSTconst { v_0 := b.Controls[0] - c := v_0.AuxInt + c := auxIntToInt64(v_0.AuxInt) x := v_0.Args[0] if !(oneBit(c)) { break } b.resetWithControl(BlockARM64TBNZ, x) - b.Aux = int64(ntz64(c)) + b.AuxInt = int64ToAuxInt(int64(ntz64(c))) return true } // match: (NE (TSTWconst [c] x) yes no) // cond: oneBit(int64(uint32(c))) - // result: (TBNZ {int64(ntz64(int64(uint32(c))))} x yes no) + // result: (TBNZ [int64(ntz64(int64(uint32(c))))] x yes no) for b.Controls[0].Op == OpARM64TSTWconst { v_0 := b.Controls[0] - c := v_0.AuxInt + c := auxIntToInt32(v_0.AuxInt) x := v_0.Args[0] if !(oneBit(int64(uint32(c)))) { break } b.resetWithControl(BlockARM64TBNZ, x) - b.Aux = int64(ntz64(int64(uint32(c)))) + b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c))))) return true } // match: (NE (FlagEQ) yes no) @@ -28434,16 +28434,16 @@ func rewriteBlockARM64(b *Block) bool { } // match: (NZ (ANDconst [c] x) yes no) // cond: oneBit(c) - // result: (TBNZ {int64(ntz64(c))} x yes no) + // result: (TBNZ [int64(ntz64(c))] x yes no) for b.Controls[0].Op == OpARM64ANDconst { v_0 := b.Controls[0] - c := v_0.AuxInt + c := auxIntToInt64(v_0.AuxInt) x := v_0.Args[0] if !(oneBit(c)) { break } b.resetWithControl(BlockARM64TBNZ, x) - b.Aux = int64(ntz64(c)) + b.AuxInt = int64ToAuxInt(int64(ntz64(c))) return true } // match: (NZ (MOVDconst [0]) yes no) @@ -28472,16 +28472,16 @@ func rewriteBlockARM64(b *Block) bool { case BlockARM64NZW: // match: (NZW (ANDconst [c] x) yes no) // cond: oneBit(int64(uint32(c))) - // result: (TBNZ {int64(ntz64(int64(uint32(c))))} x yes no) + // result: (TBNZ [int64(ntz64(int64(uint32(c))))] x yes no) for b.Controls[0].Op == OpARM64ANDconst { v_0 := b.Controls[0] - c := v_0.AuxInt + c := auxIntToInt64(v_0.AuxInt) x := v_0.Args[0] if !(oneBit(int64(uint32(c)))) { break } b.resetWithControl(BlockARM64TBNZ, x) - b.Aux = int64(ntz64(int64(uint32(c)))) + b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c))))) return true } // match: (NZW (MOVDconst [c]) yes no) @@ -28678,16 +28678,16 @@ func rewriteBlockARM64(b *Block) bool { case BlockARM64Z: // match: (Z (ANDconst [c] x) yes no) // cond: oneBit(c) - // result: (TBZ {int64(ntz64(c))} x yes no) + // result: (TBZ [int64(ntz64(c))] x yes no) for b.Controls[0].Op == OpARM64ANDconst { v_0 := b.Controls[0] - c := v_0.AuxInt + c := auxIntToInt64(v_0.AuxInt) x := v_0.Args[0] if !(oneBit(c)) { break } b.resetWithControl(BlockARM64TBZ, x) - b.Aux = int64(ntz64(c)) + b.AuxInt = int64ToAuxInt(int64(ntz64(c))) return true } // match: (Z (MOVDconst [0]) yes no) @@ -28716,16 +28716,16 @@ func rewriteBlockARM64(b *Block) bool { case BlockARM64ZW: // match: (ZW (ANDconst [c] x) yes no) // cond: oneBit(int64(uint32(c))) - // result: (TBZ {int64(ntz64(int64(uint32(c))))} x yes no) + // result: (TBZ [int64(ntz64(int64(uint32(c))))] x yes no) for b.Controls[0].Op == OpARM64ANDconst { v_0 := b.Controls[0] - c := v_0.AuxInt + c := auxIntToInt64(v_0.AuxInt) x := v_0.Args[0] if !(oneBit(int64(uint32(c)))) { break } b.resetWithControl(BlockARM64TBZ, x) - b.Aux = int64(ntz64(int64(uint32(c)))) + b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c))))) return true } // match: (ZW (MOVDconst [c]) yes no) |