Merge commit 'dec0daa8f6d0a0e1c702f169abb6bf3eee198c67' into sync_cg_clif-2023-03-15

This commit is contained in:
bjorn3
2023-03-15 14:41:48 +00:00
52 changed files with 873 additions and 792 deletions

View File

@@ -347,12 +347,20 @@ pub(crate) fn codegen_float_binop<'tcx>(
BinOp::Mul => b.fmul(lhs, rhs),
BinOp::Div => b.fdiv(lhs, rhs),
BinOp::Rem => {
let name = match in_lhs.layout().ty.kind() {
ty::Float(FloatTy::F32) => "fmodf",
ty::Float(FloatTy::F64) => "fmod",
let (name, ty) = match in_lhs.layout().ty.kind() {
ty::Float(FloatTy::F32) => ("fmodf", types::F32),
ty::Float(FloatTy::F64) => ("fmod", types::F64),
_ => bug!(),
};
return fx.easy_call(name, &[in_lhs, in_rhs], in_lhs.layout().ty);
let ret_val = fx.lib_call(
name,
vec![AbiParam::new(ty), AbiParam::new(ty)],
vec![AbiParam::new(ty)],
&[lhs, rhs],
)[0];
return CValue::by_val(ret_val, in_lhs.layout());
}
BinOp::Eq | BinOp::Lt | BinOp::Le | BinOp::Ne | BinOp::Ge | BinOp::Gt => {
let fltcc = match bin_op {