mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
Cast i64 to f64 instead of using builtin bitcode
This commit is contained in:
parent
d37ed89653
commit
a7da54516a
2 changed files with 9 additions and 4 deletions
|
@ -2619,8 +2619,13 @@ fn build_int_unary_op<'a, 'ctx, 'env>(
|
|||
))
|
||||
}
|
||||
NumToFloat => {
|
||||
// TODO specialize this to be not just for i64!
|
||||
call_bitcode_fn(NumToFloat, env, &[arg.into()], "i64_to_f64_")
|
||||
// This is an Int, so we need to convert it.
|
||||
bd.build_cast(
|
||||
InstructionOpcode::SIToFP,
|
||||
arg,
|
||||
env.context.f64_type(),
|
||||
"i64_to_f64",
|
||||
)
|
||||
}
|
||||
_ => {
|
||||
unreachable!("Unrecognized int unary operation: {:?}", op);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue