authorgravatar for noam@pixelhero.devNoam Preil <noam@pixelhero.dev> 2020-05-17 04:34:18-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-17 12:03:01-04:00
log497eb3182041a199d41c4c4fb7f44fa31d8c41e3
tree3e5fbf1ed2de041a31941ce56cc10da1264686b4
parent638554544a27018fea2243bc69b6ca4ebef8d1e5

Fix the dumb in x86 too


1 files changed, 1 insertions(+), 6 deletions(-)

src-self-hosted/backend/x86.zig+1-6
...@@ -19,12 +19,7 @@ pub const Register = enum(u8) {...@@ -19,12 +19,7 @@ pub const Register = enum(u8) {
19 }19 }
2020
21 pub fn id(self: @This()) u3 {21 pub fn id(self: @This()) u3 {
22 return @intCast(u4, switch (@enumToInt(self)) {22 return @truncate(u3, @enumToInt(self));
23 0...7 => |i| i,
24 8...15 => |i| i - 8,
25 16...23 => |i| i - 16,
26 else => unreachable,
27 });
28 }23 }
29 24
30};25};