Merge commit '2bb3996244' into sync_cg_clif-2022-12-14

This commit is contained in:
bjorn3 2022-12-14 19:30:46 +01:00
commit 949699931e
53 changed files with 1675 additions and 1012 deletions

View file

@ -162,11 +162,20 @@ pub(crate) fn codegen_icmp_imm(
}
}
} else {
let rhs = i64::try_from(rhs).expect("codegen_icmp_imm rhs out of range for <128bit int");
let rhs = rhs as i64; // Truncates on purpose in case rhs is actually an unsigned value
fx.bcx.ins().icmp_imm(intcc, lhs, rhs)
}
}
pub(crate) fn type_zero_value(bcx: &mut FunctionBuilder<'_>, ty: Type) -> Value {
if ty == types::I128 {
let zero = bcx.ins().iconst(types::I64, 0);
bcx.ins().iconcat(zero, zero)
} else {
bcx.ins().iconst(ty, 0)
}
}
pub(crate) fn type_min_max_value(
bcx: &mut FunctionBuilder<'_>,
ty: Type,