[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.
This commit is contained in:
Ujjwal Sharma
2019-09-04 23:51:30 +05:30
committed by Benjamin Bouvier
parent dce8ad8229
commit 9fb8bdd6d5

View File

@@ -86,7 +86,6 @@ pub fn define(insts: &InstructionGroup, immediates: &OperandKinds) -> TransformG
let istore16 = insts.by_name("istore16"); let istore16 = insts.by_name("istore16");
let isub = insts.by_name("isub"); let isub = insts.by_name("isub");
let isub_bin = insts.by_name("isub_bin"); 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 isub_bout = insts.by_name("isub_bout");
let load = insts.by_name("load"); let load = insts.by_name("load");
let popcnt = insts.by_name("popcnt"); let popcnt = insts.by_name("popcnt");
@@ -160,8 +159,6 @@ pub fn define(insts: &InstructionGroup, immediates: &OperandKinds) -> TransformG
let b2 = var("b2"); let b2 = var("b2");
let b3 = var("b3"); let b3 = var("b3");
let b4 = var("b4"); let b4 = var("b4");
let b_in = var("b_in");
let b_int = var("b_int");
let c = var("c"); let c = var("c");
let c1 = var("c1"); let c1 = var("c1");
let c2 = var("c2"); 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. // Expansions for fcvt_from_{u,s}int for smaller integer types.
// These use expand and not widen because the controlling type variable for // 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 // these instructions are f32/f64, which are legalized as part of the expand