From 599b48d95f348da07e8f9f8f880acdf1d92df24b Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 29 Jun 2019 17:01:54 +0200 Subject: [PATCH] Narrowing legalize some more bitops --- cranelift/codegen/meta/src/shared/legalize.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cranelift/codegen/meta/src/shared/legalize.rs b/cranelift/codegen/meta/src/shared/legalize.rs index 57ad9c89b8..26f4a4543d 100644 --- a/cranelift/codegen/meta/src/shared/legalize.rs +++ b/cranelift/codegen/meta/src/shared/legalize.rs @@ -207,7 +207,7 @@ pub(crate) fn define(insts: &InstructionGroup, imm: &Immediates) -> TransformGro ], ); - for &bin_op in &[band, bor, bxor] { + for &bin_op in &[band, bor, bxor, band_not, bor_not, bxor_not] { narrow.legalize( def!(a = bin_op(x, y)), vec![ @@ -220,6 +220,16 @@ pub(crate) fn define(insts: &InstructionGroup, imm: &Immediates) -> TransformGro ); } + narrow.legalize( + def!(a = bnot(x)), + vec![ + def!((xl, xh) = isplit(x)), + def!(al = bnot(xl)), + def!(ah = bnot(xh)), + def!(a = iconcat(al, ah)), + ], + ); + narrow.legalize( def!(a = select(c, x, y)), vec![