Legalize ireduce.iN.i2N to isplit.
This commit is contained in:
@@ -61,6 +61,7 @@ pub(crate) fn define(insts: &InstructionGroup, imm: &Immediates) -> TransformGro
|
|||||||
let cls = insts.by_name("cls");
|
let cls = insts.by_name("cls");
|
||||||
let clz = insts.by_name("clz");
|
let clz = insts.by_name("clz");
|
||||||
let ctz = insts.by_name("ctz");
|
let ctz = insts.by_name("ctz");
|
||||||
|
let copy = insts.by_name("copy");
|
||||||
let fabs = insts.by_name("fabs");
|
let fabs = insts.by_name("fabs");
|
||||||
let f32const = insts.by_name("f32const");
|
let f32const = insts.by_name("f32const");
|
||||||
let f64const = insts.by_name("f64const");
|
let f64const = insts.by_name("f64const");
|
||||||
@@ -629,6 +630,14 @@ pub(crate) fn define(insts: &InstructionGroup, imm: &Immediates) -> TransformGro
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for &(ty_half, ty) in &[(I64, I128), (I32, I64)] {
|
||||||
|
let inst = ireduce.bind(ty_half).bind(ty);
|
||||||
|
expand.legalize(
|
||||||
|
def!(a = inst(x)),
|
||||||
|
vec![def!((b, c) = isplit(x)), def!(a = copy(b))],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Expand integer operations with carry for RISC architectures that don't have
|
// Expand integer operations with carry for RISC architectures that don't have
|
||||||
// the flags.
|
// the flags.
|
||||||
let intcc_ult = Literal::enumerator_for(&imm.intcc, "ult");
|
let intcc_ult = Literal::enumerator_for(&imm.intcc, "ult");
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
test compile
|
||||||
|
target x86_64
|
||||||
|
|
||||||
|
function u0:0(i64, i64) -> i64 {
|
||||||
|
block0(v0: i64, v1: i64):
|
||||||
|
v2 = iconcat v0, v1
|
||||||
|
v3 = ireduce.i64 v2
|
||||||
|
; check: v3 = copy v0
|
||||||
|
; check: return v3
|
||||||
|
return v3
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
test compile
|
||||||
|
target i686
|
||||||
|
|
||||||
|
function u0:0(i32, i32) -> i32 {
|
||||||
|
block0(v0: i32, v1: i32):
|
||||||
|
v2 = iconcat v0, v1
|
||||||
|
v3 = ireduce.i32 v2
|
||||||
|
; check: v3 = fill v0
|
||||||
|
; check: return v3
|
||||||
|
return v3
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user