aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-06-06 12:35:38 +0100
committergingerBill <bill@gingerbill.org>2021-06-06 12:35:38 +0100
commit785c27daa7a84734c29dbbbb35d084dcdd8752f2 (patch)
treef558557d79a59d1ad012d6226df7d62fcf52862b /src/llvm_backend.cpp
parent795a5910cf237b5ba6c5adcb33109b1e40a17976 (diff)
Fix 128-bit integer to float cast by explicitly calling the procedure direct; Fix #781
Diffstat (limited to 'src/llvm_backend.cpp')
-rw-r--r--src/llvm_backend.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index 505d45b93..a4e6ddbe5 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -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)) {