From 9fb8bdd6d51ef8d1b9acee2528c7ee2a64d35038 Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Wed, 4 Sep 2019 23:51:30 +0530 Subject: [PATCH] [codegen] remove support for isub borrow variants on riscv Previously, the borrow variants of isub (isub_bin, isub_bout and isub_borrow) were being legalized for isa/riscv since RISC architectures lack a flags register. This forced us to return and accept booleans for these operations, which proved to be problematic and inconvenient, especially for x86. This commit removes support for said statements and all dependent statements for isa/riscv so that we can work on a better legalization strategy in the future. --- cranelift/codegen/meta/src/shared/legalize.rs | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/cranelift/codegen/meta/src/shared/legalize.rs b/cranelift/codegen/meta/src/shared/legalize.rs index 05c74fdc47..709dab7962 100644 --- a/cranelift/codegen/meta/src/shared/legalize.rs +++ b/cranelift/codegen/meta/src/shared/legalize.rs @@ -86,7 +86,6 @@ pub fn define(insts: &InstructionGroup, immediates: &OperandKinds) -> TransformG let istore16 = insts.by_name("istore16"); let isub = insts.by_name("isub"); let isub_bin = insts.by_name("isub_bin"); - let isub_borrow = insts.by_name("isub_borrow"); let isub_bout = insts.by_name("isub_bout"); let load = insts.by_name("load"); let popcnt = insts.by_name("popcnt"); @@ -160,8 +159,6 @@ pub fn define(insts: &InstructionGroup, immediates: &OperandKinds) -> TransformG let b2 = var("b2"); let b3 = var("b3"); let b4 = var("b4"); - let b_in = var("b_in"); - let b_int = var("b_int"); let c = var("c"); let c1 = var("c1"); let c2 = var("c2"); @@ -459,33 +456,6 @@ pub fn define(insts: &InstructionGroup, immediates: &OperandKinds) -> TransformG } } - // Expand integer operations with carry for RISC architectures that don't have - // the flags. - let intcc_ugt = Literal::enumerator_for(intcc, "ugt"); - expand.legalize( - def!((a, b) = isub_bout(x, y)), - vec![def!(a = isub(x, y)), def!(b = icmp(intcc_ugt, a, x))], - ); - - expand.legalize( - def!(a = isub_bin(x, y, b)), - vec![ - def!(a1 = isub(x, y)), - def!(b_int = bint(b)), - def!(a = isub(a1, b_int)), - ], - ); - - expand.legalize( - def!((a, b) = isub_borrow(x, y, b_in)), - vec![ - def!((a1, b1) = isub_bout(x, y)), - def!(b_int = bint(b_in)), - def!((a, b2) = isub_bout(a1, b_int)), - def!(b = bor(b1, b2)), - ], - ); - // Expansions for fcvt_from_{u,s}int for smaller integer types. // These use expand and not widen because the controlling type variable for // these instructions are f32/f64, which are legalized as part of the expand