mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 15:03:46 +00:00
32-bit float checked float operations assumed f64
This commit is contained in:
parent
a3c062d845
commit
9c94930d6a
1 changed files with 11 additions and 12 deletions
|
@ -1853,6 +1853,11 @@ fn build_float_binop<'ctx>(
|
|||
|
||||
let bd = env.builder;
|
||||
|
||||
let float_type = match float_width {
|
||||
FloatWidth::F32 => env.context.f32_type(),
|
||||
FloatWidth::F64 => env.context.f64_type(),
|
||||
};
|
||||
|
||||
match op {
|
||||
NumAdd => bd.new_build_float_add(lhs, rhs, "add_float").into(),
|
||||
NumAddChecked => {
|
||||
|
@ -1865,10 +1870,8 @@ fn build_float_binop<'ctx>(
|
|||
.into_int_value();
|
||||
let is_infinite = bd.new_build_not(is_finite, "negate");
|
||||
|
||||
let struct_type = context.struct_type(
|
||||
&[context.f64_type().into(), context.bool_type().into()],
|
||||
false,
|
||||
);
|
||||
let struct_type =
|
||||
context.struct_type(&[float_type.into(), context.bool_type().into()], false);
|
||||
|
||||
let struct_value = {
|
||||
let v1 = struct_type.const_zero();
|
||||
|
@ -1894,10 +1897,8 @@ fn build_float_binop<'ctx>(
|
|||
.into_int_value();
|
||||
let is_infinite = bd.new_build_not(is_finite, "negate");
|
||||
|
||||
let struct_type = context.struct_type(
|
||||
&[context.f64_type().into(), context.bool_type().into()],
|
||||
false,
|
||||
);
|
||||
let struct_type =
|
||||
context.struct_type(&[float_type.into(), context.bool_type().into()], false);
|
||||
|
||||
let struct_value = {
|
||||
let v1 = struct_type.const_zero();
|
||||
|
@ -1924,10 +1925,8 @@ fn build_float_binop<'ctx>(
|
|||
.into_int_value();
|
||||
let is_infinite = bd.new_build_not(is_finite, "negate");
|
||||
|
||||
let struct_type = context.struct_type(
|
||||
&[context.f64_type().into(), context.bool_type().into()],
|
||||
false,
|
||||
);
|
||||
let struct_type =
|
||||
context.struct_type(&[float_type.into(), context.bool_type().into()], false);
|
||||
|
||||
let struct_value = {
|
||||
let v1 = struct_type.const_zero();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue