authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-05-10 21:30:39+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-05-10 21:30:39+02:00
log3c69810fe6660fa3115d345bb60b3f811ac7c8c0
tree4a4c55670c05135cc28b2d0509245588aee05207
parentf6f98a621f70a10078fe3de688fe4f8c2e027a30

x64: fix binary not implementation


2 files changed, 2 insertions(+), 2 deletions(-)

src/arch/x86_64/CodeGen.zig+2-1
......@@ -1154,7 +1154,8 @@ fn airNot(self: *Self, inst: Air.Inst.Index) !void {
11541154 };
11551155 defer if (dst_mcv_lock) |lock| self.register_manager.unlockReg(lock);
11561156
1157 try self.genBinOpMir(.xor, operand_ty, dst_mcv, .{ .immediate = 1 });
1157 const mask = ~@as(u64, 0);
1158 try self.genBinOpMir(.xor, operand_ty, dst_mcv, .{ .immediate = mask });
11581159
11591160 break :result dst_mcv;
11601161 };
test/behavior/math.zig-1
......@@ -362,7 +362,6 @@ fn comptimeAdd(comptime a: comptime_int, comptime b: comptime_int) comptime_int
362362
363363test "binary not" {
364364 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
365 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
366365
367366 try expect(comptime x: {
368367 break :x ~@as(u16, 0b1010101010101010) == 0b0101010101010101;