Fix 128-bit integer to float cast by explicitly calling the procedure direct; Fix #781

This commit is contained in:
gingerBill
2021-06-06 12:35:38 +01:00
parent 795a5910cf
commit 785c27daa7
5 changed files with 97 additions and 84 deletions

View File

@@ -7821,6 +7821,17 @@ lbValue lb_emit_conv(lbProcedure *p, lbValue value, Type *t) {
return lb_emit_conv(p, res, t);
}
if (is_type_integer_128bit(src)) {
auto args = array_make<lbValue>(temporary_allocator(), 1);
args[0] = value;
char const *call = "floattidf";
if (is_type_unsigned(src)) {
call = "floattidf_unsigned";
}
lbValue res_f64 = lb_emit_runtime_call(p, call, args);
return lb_emit_conv(p, res_f64, t);
}
lbValue res = {};
res.type = t;
if (is_type_unsigned(src)) {