Skip to content

Commit 00c8d7e

Browse files
committed
Partially revert "LLVM: work around @floatFromInt bug"
This partially reverts commit ab4d6bf.
1 parent cfddf49 commit 00c8d7e

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/codegen/llvm.zig

+1-19
Original file line numberDiff line numberDiff line change
@@ -6351,29 +6351,11 @@ pub const FuncGen = struct {
63516351
const zcu = pt.zcu;
63526352
const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
63536353

6354-
const workaround_operand = try self.resolveInst(ty_op.operand);
6354+
const operand = try self.resolveInst(ty_op.operand);
63556355
const operand_ty = self.typeOf(ty_op.operand);
63566356
const operand_scalar_ty = operand_ty.scalarType(zcu);
63576357
const is_signed_int = operand_scalar_ty.isSignedInt(zcu);
63586358

6359-
const operand = o: {
6360-
// Work around LLVM bug. See https://github.com/ziglang/zig/issues/17381.
6361-
const bit_size = operand_scalar_ty.bitSize(zcu);
6362-
for ([_]u8{ 8, 16, 32, 64, 128 }) |b| {
6363-
if (bit_size < b) {
6364-
break :o try self.wip.cast(
6365-
if (is_signed_int) .sext else .zext,
6366-
workaround_operand,
6367-
try o.builder.intType(b),
6368-
"",
6369-
);
6370-
} else if (bit_size == b) {
6371-
break :o workaround_operand;
6372-
}
6373-
}
6374-
break :o workaround_operand;
6375-
};
6376-
63776359
const dest_ty = self.typeOfIndex(inst);
63786360
const dest_scalar_ty = dest_ty.scalarType(zcu);
63796361
const dest_llvm_ty = try o.lowerType(dest_ty);

0 commit comments

Comments
 (0)