diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-10-21 12:11:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-21 12:11:49 +0200 |
| commit | 972c39e2c00c487a483bad002ef33ca1a5c21d02 (patch) | |
| tree | 8a5ef4ae22f2a36b020062a913c79278bfb79a30 /src/codegen/llvm.zig | |
| parent | 41575b1f55b0f18d65bfeb23dc04a5489ed47b65 (diff) | |
| parent | 2609e33ab08850405682a79f60cca66c13f9a40d (diff) | |
| download | zig-972c39e2c00c487a483bad002ef33ca1a5c21d02.tar.gz zig-972c39e2c00c487a483bad002ef33ca1a5c21d02.zip | |
Merge pull request #13219 from Vexu/stage2-fixes
Stage2 bug fixes
Diffstat (limited to 'src/codegen/llvm.zig')
| -rw-r--r-- | src/codegen/llvm.zig | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index f90943cc54..b0d1588007 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -3125,10 +3125,10 @@ pub const DeclGen = struct { .as_u16 => { try llvm_params.append(dg.context.intType(16)); }, - .float_array => { + .float_array => |count| { const param_ty = fn_info.param_types[it.zig_index - 1]; - const float_ty = try dg.lowerType(param_ty.structFieldType(0)); - const field_count = @intCast(c_uint, param_ty.structFieldCount()); + const float_ty = try dg.lowerType(aarch64_c_abi.getFloatArrayType(param_ty).?); + const field_count = @intCast(c_uint, count); const arr_ty = float_ty.arrayType(field_count); try llvm_params.append(arr_ty); }, @@ -4801,7 +4801,7 @@ pub const FuncGen = struct { const casted = self.builder.buildBitCast(llvm_arg, self.dg.context.intType(16), ""); try llvm_args.append(casted); }, - .float_array => { + .float_array => |count| { const arg = args[it.zig_index - 1]; const arg_ty = self.air.typeOf(arg); var llvm_arg = try self.resolveInst(arg); @@ -4812,9 +4812,8 @@ pub const FuncGen = struct { llvm_arg = store_inst; } - const float_ty = try self.dg.lowerType(arg_ty.structFieldType(0)); - const field_count = @intCast(u32, arg_ty.structFieldCount()); - const array_llvm_ty = float_ty.arrayType(field_count); + const float_ty = try self.dg.lowerType(aarch64_c_abi.getFloatArrayType(arg_ty).?); + const array_llvm_ty = float_ty.arrayType(count); const casted = self.builder.buildBitCast(llvm_arg, array_llvm_ty.pointerType(0), ""); const alignment = arg_ty.abiAlignment(target); @@ -10214,7 +10213,7 @@ const ParamTypeIterator = struct { llvm_types_buffer: [8]u16, byval_attr: bool, - const Lowering = enum { + const Lowering = union(enum) { no_bits, byval, byref, @@ -10223,7 +10222,7 @@ const ParamTypeIterator = struct { multiple_llvm_float, slice, as_u16, - float_array, + float_array: u8, }; pub fn next(it: *ParamTypeIterator) ?Lowering { @@ -10400,7 +10399,7 @@ const ParamTypeIterator = struct { return .byref; } if (classes[0] == .float_array) { - return .float_array; + return Lowering{ .float_array = @enumToInt(classes[1]) }; } if (classes[1] == .none) { it.llvm_types_len = 1; |
