aboutsummaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-03-27 04:30:41 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2023-03-27 05:58:00 -0400
commit802c2e4fae4450679c995767d6409dbc9cf568b3 (patch)
tree6a7b408a7e988db7e9a0e65cf088e736555f5fca /src/arch
parent6c5442841565196ddeb90735496aad04db3ecdfd (diff)
downloadzig-802c2e4fae4450679c995767d6409dbc9cf568b3.tar.gz
zig-802c2e4fae4450679c995767d6409dbc9cf568b3.zip
x86_64: fix popcnt and disable regressed test
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86_64/CodeGen.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig
index a3615611ba..5f39bc586a 100644
--- a/src/arch/x86_64/CodeGen.zig
+++ b/src/arch/x86_64/CodeGen.zig
@@ -3095,7 +3095,8 @@ fn airPopcount(self: *Self, inst: Air.Inst.Index) !void {
};
defer if (mat_src_lock) |lock| self.register_manager.unlockReg(lock);
- const dst_mcv: MCValue = if (self.reuseOperand(inst, ty_op.operand, 0, src_mcv))
+ const dst_mcv: MCValue =
+ if (src_mcv.isRegister() and self.reuseOperand(inst, ty_op.operand, 0, src_mcv))
src_mcv
else
.{ .register = try self.register_manager.allocReg(inst, gp) };
@@ -5478,6 +5479,9 @@ fn airCmp(self: *Self, inst: Air.Inst.Index, op: math.CompareOperator) !void {
}
const ty = self.air.typeOf(bin_op.lhs);
+ const abi_size = ty.abiSize(self.target.*);
+ if (abi_size > 8) return self.fail("TODO implement cmp for large values", .{});
+
const signedness: std.builtin.Signedness = blk: {
// For non-int types, we treat the values as unsigned
if (ty.zigTypeTag() != .Int) break :blk .unsigned;