diff options
| author | Jorropo <jorropo.pgm@gmail.com> | 2026-03-29 05:06:28 +0200 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-03-31 10:58:48 -0700 |
| commit | d9fbe4c90d956f7835224f4de1afcf799e8cc3ed (patch) | |
| tree | 7abada6931391ebd4659ff941f4c8617064f66fa /src/cmd/compile/internal/ssa/_gen/generic.rules | |
| parent | de7f006df2a70df34d6bd814489ba675153e829e (diff) | |
| download | go-d9fbe4c90d956f7835224f4de1afcf799e8cc3ed.tar.xz | |
cmd/compile: convert some condmoves in XOR
Similar to CL 685676 but for XOR.
Change-Id: Ib5ffd4c13348f176a808b3218fdbbafc2c42794f
Reviewed-on: https://go-review.googlesource.com/c/go/+/760921
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/_gen/generic.rules')
| -rw-r--r-- | src/cmd/compile/internal/ssa/_gen/generic.rules | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/_gen/generic.rules b/src/cmd/compile/internal/ssa/_gen/generic.rules index fe34b53be2..7dcf818976 100644 --- a/src/cmd/compile/internal/ssa/_gen/generic.rules +++ b/src/cmd/compile/internal/ssa/_gen/generic.rules @@ -2316,6 +2316,10 @@ (CondSelect (Or8 <t> x (Const8 [1])) x bool) => (Or8 x (CvtBoolToUint8 <t> bool)) (CondSelect (Or(64|32|16) <t> x (Const(64|32|16) [1])) x bool) => (Or(64|32|16) x (ZeroExt8to(64|32|16) <t> (CvtBoolToUint8 <types.Types[types.TUINT8]> bool))) +// if b { x ^= 1 } => x ^= b +(CondSelect (Xor8 <t> x (Const8 [1])) x bool) => (Xor8 x (CvtBoolToUint8 <t> bool)) +(CondSelect (Xor(64|32|16) <t> x (Const(64|32|16) [1])) x bool) => (Xor(64|32|16) x (ZeroExt8to(64|32|16) <t> (CvtBoolToUint8 <types.Types[types.TUINT8]> bool))) + // bool(int(x)) => x (Neq8 (CvtBoolToUint8 x) (Const8 [0])) => x (Neq8 (CvtBoolToUint8 x) (Const8 [1])) => (Not x) |
