mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-18 20:02:22 -07:00
Fix 128-bit integer to float cast by explicitly calling the procedure direct; Fix #781
This commit is contained in:
@@ -1751,6 +1751,7 @@ void generate_minimum_dependency_set(Checker *c, Entity *start) {
|
||||
str_lit("divti3"),
|
||||
str_lit("fixdfti"),
|
||||
str_lit("floattidf"),
|
||||
str_lit("floattidf_unsigned"),
|
||||
str_lit("truncsfhf2"),
|
||||
str_lit("truncdfhf2"),
|
||||
str_lit("gnu_h2f_ieee"),
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user