aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2023-01-11 23:02:06 +0200
committerVeikka Tuominen <git@vexu.eu>2023-01-14 16:26:50 +0200
commit0013042cbd539cf7eb463483633e9f7aa2fa8067 (patch)
tree4346a3276ec07b35e3d90df88a8c5528c1fd7f96 /src/codegen/llvm.zig
parent5572c67e73222716372762d30453cc44ca4339c0 (diff)
downloadzig-0013042cbd539cf7eb463483633e9f7aa2fa8067.tar.gz
zig-0013042cbd539cf7eb463483633e9f7aa2fa8067.zip
llvm: correctly handle C ABI structs with f32/f64 alignment differences
Closes #13830
Diffstat (limited to 'src/codegen/llvm.zig')
-rw-r--r--src/codegen/llvm.zig16
1 files changed, 16 insertions, 0 deletions
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;