diff options
| author | Noam Preil <pleasantatk@gmail.com> | 2020-05-17 04:06:17 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-05-17 12:03:01 -0400 |
| commit | 638554544a27018fea2243bc69b6ca4ebef8d1e5 (patch) | |
| tree | 69dc18ec8ad14afecd9db11857a1c61a11943926 /src-self-hosted | |
| parent | 13ea698a40acb88063e7e6bd633fc2848d3d3a05 (diff) | |
| download | zig-638554544a27018fea2243bc69b6ca4ebef8d1e5.tar.gz zig-638554544a27018fea2243bc69b6ca4ebef8d1e5.zip | |
Fix a dumb (thanks daurminator!)
Diffstat (limited to 'src-self-hosted')
| -rw-r--r-- | src-self-hosted/backend/x86_64.zig | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src-self-hosted/backend/x86_64.zig b/src-self-hosted/backend/x86_64.zig index 50b5d31273..2d63dd9aa5 100644 --- a/src-self-hosted/backend/x86_64.zig +++ b/src-self-hosted/backend/x86_64.zig @@ -35,13 +35,7 @@ pub const Register = enum(u8) { } pub fn id(self: @This()) u4 { - return @intCast(u4, switch (@enumToInt(self)) { - 0...15 => |i| i, - 16...31 => |i| i - 16, - 32...47 => |i| i - 32, - 48...64 => |i| i - 48, - else => unreachable, - }); + return @truncate(u4, @enumToInt(self)); } }; |
