From c5ee73f65b4c77fe08aa44b8611bf084ae700f24 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 13 Jan 2022 10:42:38 -0700 Subject: stage2: fix build on 32-bit ISAs Fixes regression introduced in 93b854eb745ab3294054ae71150fe60f134f4d10. --- src/codegen/c.zig | 2 +- src/codegen/llvm.zig | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/codegen') diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 0bd543fab7..05ec1b1a88 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -3038,7 +3038,7 @@ fn airVectorInit(f: *Function, inst: Air.Inst.Index) !CValue { const inst_ty = f.air.typeOfIndex(inst); const ty_pl = f.air.instructions.items(.data)[inst].ty_pl; const vector_ty = f.air.getRefType(ty_pl.ty); - const len = @intCast(u32, vector_ty.arrayLen()); + const len = vector_ty.vectorLen(); const elements = @bitCast([]const Air.Inst.Ref, f.air.extra[ty_pl.payload..][0..len]); const writer = f.object.writer(); diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 7b94410912..7858fa76fa 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -873,7 +873,7 @@ pub const DeclGen = struct { }, .Vector => { const elem_type = try dg.llvmType(t.childType()); - return elem_type.vectorType(@intCast(c_uint, t.arrayLen())); + return elem_type.vectorType(t.vectorLen()); }, .Optional => { var buf: Type.Payload.ElemType = undefined; @@ -4170,7 +4170,7 @@ pub const FuncGen = struct { const target = self.dg.module.getTarget(); const bits = operand_ty.intInfo(target).bits; const vec_len: ?u32 = switch (operand_ty.zigTypeTag()) { - .Vector => @intCast(u32, operand_ty.arrayLen()), + .Vector => operand_ty.vectorLen(), else => null, }; @@ -4372,7 +4372,7 @@ pub const FuncGen = struct { const scalar = try self.resolveInst(ty_op.operand); const scalar_ty = self.air.typeOf(ty_op.operand); const vector_ty = self.air.typeOfIndex(inst); - const len = @intCast(u32, vector_ty.arrayLen()); + const len = vector_ty.vectorLen(); const scalar_llvm_ty = try self.dg.llvmType(scalar_ty); const op_llvm_ty = scalar_llvm_ty.vectorType(1); const u32_llvm_ty = self.context.intType(32); -- cgit v1.2.3