From de7f006df2a70df34d6bd814489ba675153e829e Mon Sep 17 00:00:00 2001 From: Jorropo Date: Sun, 29 Mar 2026 05:02:45 +0200 Subject: 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 LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall Reviewed-by: Keith Randall Reviewed-by: Junyang Shao --- test/codegen/condmove.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/codegen') 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 -- cgit v1.3-5-g9baa