@@ -14734,39 +14734,23 @@ pub fn toBitcode(self: *Builder, allocator: Allocator) bitcode_writer.Error![]co
}, adapter);
},
.add,
.@"add nsw",
.@"add nuw",
.@"add nuw nsw",
.@"and",
.fadd,
.fdiv,
.fmul,
.mul,
.@"mul nsw",
.@"mul nuw",
.@"mul nuw nsw",
.frem,
.fsub,
.sdiv,
.@"sdiv exact",
.sub,
.@"sub nsw",
.@"sub nuw",
.@"sub nuw nsw",
.udiv,
.@"udiv exact",
.xor,
.shl,
.@"shl nsw",
.@"shl nuw",
.@"shl nuw nsw",
.lshr,
.@"lshr exact",
.@"or",
.urem,
.srem,
.ashr,
.@"ashr exact",
=> |kind| {
const extra = func.extraData(Function.Instruction.Binary, datas[instr_index]);
try function_block.writeAbbrev(FunctionBlock.Binary{
@@ -14775,6 +14759,56 @@ pub fn toBitcode(self: *Builder, allocator: Allocator) bitcode_writer.Error![]co
.rhs = adapter.getOffsetValueIndex(extra.rhs),
});
},
.@"sdiv exact",
.@"udiv exact",
.@"lshr exact",
.@"ashr exact",
=> |kind| {
const extra = func.extraData(Function.Instruction.Binary, datas[instr_index]);
try function_block.writeAbbrev(FunctionBlock.BinaryExact{
.opcode = kind.toBinaryOpcode(),
.lhs = adapter.getOffsetValueIndex(extra.lhs),
.rhs = adapter.getOffsetValueIndex(extra.rhs),
});
},
.@"add nsw",
.@"add nuw",
.@"add nuw nsw",
.@"mul nsw",
.@"mul nuw",
.@"mul nuw nsw",
.@"sub nsw",
.@"sub nuw",
.@"sub nuw nsw",
.@"shl nsw",
.@"shl nuw",
.@"shl nuw nsw",
=> |kind| {
const extra = func.extraData(Function.Instruction.Binary, datas[instr_index]);
try function_block.writeAbbrev(FunctionBlock.BinaryNoWrap{
.opcode = kind.toBinaryOpcode(),
.lhs = adapter.getOffsetValueIndex(extra.lhs),
.rhs = adapter.getOffsetValueIndex(extra.rhs),
.flags = switch (kind) {
.@"add nsw",
.@"mul nsw",
.@"sub nsw",
.@"shl nsw",
=> .{ .no_unsigned_wrap = false, .no_signed_wrap = true },
.@"add nuw",
.@"mul nuw",
.@"sub nuw",
.@"shl nuw",
=> .{ .no_unsigned_wrap = true, .no_signed_wrap = false },
.@"add nuw nsw",
.@"mul nuw nsw",
.@"sub nuw nsw",
.@"shl nuw nsw",
=> .{ .no_unsigned_wrap = true, .no_signed_wrap = true },
else => unreachable,
},
});
},
.@"fadd fast",
.@"fdiv fast",
.@"fmul fast",