aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/rewrite386.go
diff options
context:
space:
mode:
authorMichael Munday <mike.munday@ibm.com>2020-02-20 17:46:08 +0000
committerMichael Munday <mike.munday@ibm.com>2020-02-26 13:11:53 +0000
commitcb74dcc172de2779a2f65ea830f687156c98ad50 (patch)
treef94450c829e15288289bcf99f27b91ede70954eb /src/cmd/compile/internal/ssa/rewrite386.go
parent44fe355694798b5e1c55fc087e697886e93e633e (diff)
downloadgo-cb74dcc172de2779a2f65ea830f687156c98ad50.tar.gz
go-cb74dcc172de2779a2f65ea830f687156c98ad50.zip
cmd/compile: remove Greater* and Geq* generic integer ops
The generic Greater and Geq ops can always be replaced with the Less and Leq ops. This CL therefore removes them. This simplifies the compiler since it reduces the number of operations that need handling in both code and in rewrite rules. This will be especially true when adding control flow optimizations such as the integer-in-range optimizations in CL 165998. Change-Id: If0648b2b19998ac1bddccbf251283f3be4ec3040 Reviewed-on: https://go-review.googlesource.com/c/go/+/220417 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/rewrite386.go')
-rw-r--r--src/cmd/compile/internal/ssa/rewrite386.go228
1 files changed, 0 insertions, 228 deletions
diff --git a/src/cmd/compile/internal/ssa/rewrite386.go b/src/cmd/compile/internal/ssa/rewrite386.go
index 8c2d1f8a81..3472f404cd 100644
--- a/src/cmd/compile/internal/ssa/rewrite386.go
+++ b/src/cmd/compile/internal/ssa/rewrite386.go
@@ -444,22 +444,10 @@ func rewriteValue386(v *Value) bool {
return rewriteValue386_OpEqB(v)
case OpEqPtr:
return rewriteValue386_OpEqPtr(v)
- case OpGeq16:
- return rewriteValue386_OpGeq16(v)
- case OpGeq16U:
- return rewriteValue386_OpGeq16U(v)
- case OpGeq32:
- return rewriteValue386_OpGeq32(v)
case OpGeq32F:
return rewriteValue386_OpGeq32F(v)
- case OpGeq32U:
- return rewriteValue386_OpGeq32U(v)
case OpGeq64F:
return rewriteValue386_OpGeq64F(v)
- case OpGeq8:
- return rewriteValue386_OpGeq8(v)
- case OpGeq8U:
- return rewriteValue386_OpGeq8U(v)
case OpGetCallerPC:
v.Op = Op386LoweredGetCallerPC
return true
@@ -472,22 +460,10 @@ func rewriteValue386(v *Value) bool {
case OpGetG:
v.Op = Op386LoweredGetG
return true
- case OpGreater16:
- return rewriteValue386_OpGreater16(v)
- case OpGreater16U:
- return rewriteValue386_OpGreater16U(v)
- case OpGreater32:
- return rewriteValue386_OpGreater32(v)
case OpGreater32F:
return rewriteValue386_OpGreater32F(v)
- case OpGreater32U:
- return rewriteValue386_OpGreater32U(v)
case OpGreater64F:
return rewriteValue386_OpGreater64F(v)
- case OpGreater8:
- return rewriteValue386_OpGreater8(v)
- case OpGreater8U:
- return rewriteValue386_OpGreater8U(v)
case OpHmul32:
v.Op = Op386HMULL
return true
@@ -13850,57 +13826,6 @@ func rewriteValue386_OpEqPtr(v *Value) bool {
return true
}
}
-func rewriteValue386_OpGeq16(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- // match: (Geq16 x y)
- // result: (SETGE (CMPW x y))
- for {
- x := v_0
- y := v_1
- v.reset(Op386SETGE)
- v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValue386_OpGeq16U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- // match: (Geq16U x y)
- // result: (SETAE (CMPW x y))
- for {
- x := v_0
- y := v_1
- v.reset(Op386SETAE)
- v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValue386_OpGeq32(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- // match: (Geq32 x y)
- // result: (SETGE (CMPL x y))
- for {
- x := v_0
- y := v_1
- v.reset(Op386SETGE)
- v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
func rewriteValue386_OpGeq32F(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
@@ -13918,23 +13843,6 @@ func rewriteValue386_OpGeq32F(v *Value) bool {
return true
}
}
-func rewriteValue386_OpGeq32U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- // match: (Geq32U x y)
- // result: (SETAE (CMPL x y))
- for {
- x := v_0
- y := v_1
- v.reset(Op386SETAE)
- v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
func rewriteValue386_OpGeq64F(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
@@ -13952,91 +13860,6 @@ func rewriteValue386_OpGeq64F(v *Value) bool {
return true
}
}
-func rewriteValue386_OpGeq8(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- // match: (Geq8 x y)
- // result: (SETGE (CMPB x y))
- for {
- x := v_0
- y := v_1
- v.reset(Op386SETGE)
- v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValue386_OpGeq8U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- // match: (Geq8U x y)
- // result: (SETAE (CMPB x y))
- for {
- x := v_0
- y := v_1
- v.reset(Op386SETAE)
- v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValue386_OpGreater16(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- // match: (Greater16 x y)
- // result: (SETG (CMPW x y))
- for {
- x := v_0
- y := v_1
- v.reset(Op386SETG)
- v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValue386_OpGreater16U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- // match: (Greater16U x y)
- // result: (SETA (CMPW x y))
- for {
- x := v_0
- y := v_1
- v.reset(Op386SETA)
- v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValue386_OpGreater32(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- // match: (Greater32 x y)
- // result: (SETG (CMPL x y))
- for {
- x := v_0
- y := v_1
- v.reset(Op386SETG)
- v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
func rewriteValue386_OpGreater32F(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
@@ -14054,23 +13877,6 @@ func rewriteValue386_OpGreater32F(v *Value) bool {
return true
}
}
-func rewriteValue386_OpGreater32U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- // match: (Greater32U x y)
- // result: (SETA (CMPL x y))
- for {
- x := v_0
- y := v_1
- v.reset(Op386SETA)
- v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
func rewriteValue386_OpGreater64F(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
@@ -14088,40 +13894,6 @@ func rewriteValue386_OpGreater64F(v *Value) bool {
return true
}
}
-func rewriteValue386_OpGreater8(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- // match: (Greater8 x y)
- // result: (SETG (CMPB x y))
- for {
- x := v_0
- y := v_1
- v.reset(Op386SETG)
- v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValue386_OpGreater8U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- // match: (Greater8U x y)
- // result: (SETA (CMPB x y))
- for {
- x := v_0
- y := v_1
- v.reset(Op386SETA)
- v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
func rewriteValue386_OpIsInBounds(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]