aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authorJorropo <jorropo.pgm@gmail.com>2026-03-29 05:02:45 +0200
committerGopher Robot <gobot@golang.org>2026-03-31 10:58:45 -0700
commitde7f006df2a70df34d6bd814489ba675153e829e (patch)
tree222dc36a52bc03b3c8569d31554c45ad931d86ea /test/codegen
parent97259c5d6b5928b4519a227b2e5a540259c49bbd (diff)
downloadgo-de7f006df2a70df34d6bd814489ba675153e829e.tar.xz
cmd/compile: convert some condmoves in OR
Similar to CL 685676 but for OR. Change-Id: I0ddfd457ed9e8888462306138a251ac48ad42084 Reviewed-on: https://go-review.googlesource.com/c/go/+/760920 Auto-Submit: Jorropo <jorropo.pgm@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Junyang Shao <shaojunyang@google.com>
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/condmove.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/codegen/condmove.go b/test/codegen/condmove.go
index 93159d1ca4..7ccdd6e3e1 100644
--- a/test/codegen/condmove.go
+++ b/test/codegen/condmove.go
@@ -510,6 +510,17 @@ func cmovmathhalveu(a uint, b bool) uint {
return a
}
+func cmovmathor(a uint, b bool) uint {
+ if b {
+ a |= 1
+ }
+ // amd64:"ORQ", -"CMOV"
+ // arm64:"ORR", -"CSEL"
+ // ppc64x:"OR", -"ISEL"
+ // wasm:"I64Or", -"Select"
+ return a
+}
+
func branchlessBoolToUint8(b bool) (r uint8) {
if b {
r = 1