From a181ad293271575f96c77f67c69b5a45692ae8fe Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Wed, 25 Jan 2023 17:28:48 -0800 Subject: [PATCH] Cleanup the use of `maybe_uextend` in the x64 lowerings (#5637) Use maybe_uextend for the brnz lowerings on x64. --- cranelift/codegen/src/isa/x64/lower.isle | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/cranelift/codegen/src/isa/x64/lower.isle b/cranelift/codegen/src/isa/x64/lower.isle index ec77a7fc78..cc894a0af5 100644 --- a/cranelift/codegen/src/isa/x64/lower.isle +++ b/cranelift/codegen/src/isa/x64/lower.isle @@ -2923,17 +2923,10 @@ (jmp_cond (CC.Z) taken not_taken)))) -(rule 2 (lower_branch (brnz (icmp cc a b) _) (two_targets taken not_taken)) +(rule 2 (lower_branch (brnz (maybe_uextend (icmp cc a b)) _) (two_targets taken not_taken)) (emit_side_effect (jmp_cond_icmp (emit_cmp cc a b) taken not_taken))) -(rule 2 (lower_branch (brnz (fcmp cc a b) _) (two_targets taken not_taken)) - (let ((cmp FcmpCondResult (emit_fcmp cc a b))) - (emit_side_effect (jmp_cond_fcmp cmp taken not_taken)))) - -(rule 2 (lower_branch (brnz (uextend (icmp cc a b)) _) (two_targets taken not_taken)) - (emit_side_effect (jmp_cond_icmp (emit_cmp cc a b) taken not_taken))) - -(rule 2 (lower_branch (brnz (uextend (fcmp cc a b)) _) (two_targets taken not_taken)) +(rule 2 (lower_branch (brnz (maybe_uextend (fcmp cc a b)) _) (two_targets taken not_taken)) (let ((cmp FcmpCondResult (emit_fcmp cc a b))) (emit_side_effect (jmp_cond_fcmp cmp taken not_taken))))