diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 723516fc7757950d88e68bdc0e4b788de7049a0b..42e94a3528e875f83d00a73960593c1c520273f1 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -3709,10 +3709,11 @@ pub const FuncGen = struct { const ty_op = self.air.instructions.items(.data)[inst].ty_op; const operand = try self.resolveInst(ty_op.operand); + const operand_ty = self.air.typeOf(ty_op.operand); const dest_ty = self.air.typeOfIndex(inst); const dest_llvm_ty = try self.dg.llvmType(dest_ty); - if (dest_ty.isSignedInt()) { + if (operand_ty.isSignedInt()) { return self.builder.buildSIToFP(operand, dest_llvm_ty, ""); } else { return self.builder.buildUIToFP(operand, dest_llvm_ty, "");