From 0013042cbd539cf7eb463483633e9f7aa2fa8067 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Wed, 11 Jan 2023 23:02:06 +0200 Subject: llvm: correctly handle C ABI structs with f32/f64 alignment differences Closes #13830 --- src/codegen/llvm.zig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/codegen/llvm.zig') diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 15ffe25ecd..8604c7d7f6 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -10478,6 +10478,14 @@ fn lowerFnRetTy(dg: *DeclGen, fn_info: Type.Payload.Function.Data) !*llvm.Type { llvm_types_buffer[llvm_types_index] = dg.context.doubleType(); llvm_types_index += 1; }, + .float => { + llvm_types_buffer[llvm_types_index] = dg.context.floatType(); + llvm_types_index += 1; + }, + .float_combine => { + llvm_types_buffer[llvm_types_index] = dg.context.floatType().vectorType(2); + llvm_types_index += 1; + }, .x87 => { if (llvm_types_index != 0 or classes[2] != .none) { return dg.context.voidType(); @@ -10694,6 +10702,14 @@ const ParamTypeIterator = struct { llvm_types_buffer[llvm_types_index] = dg.context.doubleType(); llvm_types_index += 1; }, + .float => { + llvm_types_buffer[llvm_types_index] = dg.context.floatType(); + llvm_types_index += 1; + }, + .float_combine => { + llvm_types_buffer[llvm_types_index] = dg.context.floatType().vectorType(2); + llvm_types_index += 1; + }, .x87 => { it.zig_index += 1; it.llvm_index += 1; -- cgit v1.2.3