Legalize uextend and sextend to 128bit ints
This commit is contained in:
@@ -207,6 +207,28 @@ pub(crate) fn define(insts: &InstructionGroup, imm: &Immediates) -> TransformGro
|
||||
// embedded as part of arguments), so use a custom legalization for now.
|
||||
narrow.custom_legalize(iconst, "narrow_iconst");
|
||||
|
||||
{
|
||||
let inst = uextend.bind(I128).bind(I64);
|
||||
narrow.legalize(
|
||||
def!(a = inst(x)),
|
||||
vec![
|
||||
def!(ah = iconst(Literal::constant(&imm.imm64, 0))),
|
||||
def!(a = iconcat(x, ah)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
let inst = sextend.bind(I128).bind(I64);
|
||||
narrow.legalize(
|
||||
def!(a = inst(x)),
|
||||
vec![
|
||||
def!(ah = sshr_imm(x, Literal::constant(&imm.imm64, 63))), // splat sign bit to whole number
|
||||
def!(a = iconcat(x, ah)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
for &bin_op in &[band, bor, bxor, band_not, bor_not, bxor_not] {
|
||||
narrow.legalize(
|
||||
def!(a = bin_op(x, y)),
|
||||
|
||||
Reference in New Issue
Block a user