| ... | @@ -7433,16 +7433,20 @@ fn genUnOp(self: *Self, maybe_inst: ?Air.Inst.Index, tag: Air.Inst.Tag, src_air: | ... | @@ -7433,16 +7433,20 @@ fn genUnOp(self: *Self, maybe_inst: ?Air.Inst.Index, tag: Air.Inst.Tag, src_air: |
| 7433 | }; | 7433 | }; |
| 7434 | defer if (dst_lock) |lock| self.register_manager.unlockReg(lock); | 7434 | defer if (dst_lock) |lock| self.register_manager.unlockReg(lock); |
| 7435 | | 7435 | |
| | 7436 | const abi_size: u16 = @intCast(src_ty.abiSize(mod)); |
| 7436 | switch (tag) { | 7437 | switch (tag) { |
| 7437 | .not => { | 7438 | .not => { |
| 7438 | const limb_abi_size: u16 = @intCast(@min(src_ty.abiSize(mod), 8)); | 7439 | const limb_abi_size: u16 = @min(abi_size, 8); |
| 7439 | const int_info = if (src_ty.ip_index == .bool_type) | 7440 | const int_info = if (src_ty.ip_index == .bool_type) |
| 7440 | std.builtin.Type.Int{ .signedness = .unsigned, .bits = 1 } | 7441 | std.builtin.Type.Int{ .signedness = .unsigned, .bits = 1 } |
| 7441 | else | 7442 | else |
| 7442 | src_ty.intInfo(mod); | 7443 | src_ty.intInfo(mod); |
| 7443 | var byte_off: i32 = 0; | 7444 | var byte_off: i32 = 0; |
| 7444 | while (byte_off * 8 < int_info.bits) : (byte_off += limb_abi_size) { | 7445 | while (byte_off * 8 < int_info.bits) : (byte_off += limb_abi_size) { |
| 7445 | const limb_bits: u16 = @intCast(@min(int_info.bits - byte_off * 8, limb_abi_size * 8)); | 7446 | const limb_bits: u16 = @intCast(@min(switch (int_info.signedness) { |
| | 7447 | .signed => abi_size * 8, |
| | 7448 | .unsigned => int_info.bits, |
| | 7449 | } - byte_off * 8, limb_abi_size * 8)); |
| 7446 | const limb_ty = try mod.intType(int_info.signedness, limb_bits); | 7450 | const limb_ty = try mod.intType(int_info.signedness, limb_bits); |
| 7447 | const limb_mcv = switch (byte_off) { | 7451 | const limb_mcv = switch (byte_off) { |
| 7448 | 0 => dst_mcv, | 7452 | 0 => dst_mcv, |
| ... | @@ -7457,7 +7461,6 @@ fn genUnOp(self: *Self, maybe_inst: ?Air.Inst.Index, tag: Air.Inst.Tag, src_air: | ... | @@ -7457,7 +7461,6 @@ fn genUnOp(self: *Self, maybe_inst: ?Air.Inst.Index, tag: Air.Inst.Tag, src_air: |
| 7457 | }, | 7461 | }, |
| 7458 | .neg => { | 7462 | .neg => { |
| 7459 | try self.genUnOpMir(.{ ._, .neg }, src_ty, dst_mcv); | 7463 | try self.genUnOpMir(.{ ._, .neg }, src_ty, dst_mcv); |
| 7460 | const abi_size: u16 = @intCast(src_ty.abiSize(mod)); | | |
| 7461 | const bit_size = src_ty.intInfo(mod).bits; | 7464 | const bit_size = src_ty.intInfo(mod).bits; |
| 7462 | if (abi_size * 8 > bit_size) { | 7465 | if (abi_size * 8 > bit_size) { |
| 7463 | if (dst_mcv.isRegister()) { | 7466 | if (dst_mcv.isRegister()) { |