| author | |
| committer | |
| log | 638554544a27018fea2243bc69b6ca4ebef8d1e5 |
| tree | 69dc18ec8ad14afecd9db11857a1c61a11943926 |
| parent | 13ea698a40acb88063e7e6bd633fc2848d3d3a05 |
1 files changed, 1 insertions(+), 7 deletions(-)
src-self-hosted/backend/x86_64.zig+1-7| ... | @@ -35,13 +35,7 @@ pub const Register = enum(u8) { | ... | @@ -35,13 +35,7 @@ pub const Register = enum(u8) { |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | pub fn id(self: @This()) u4 { | 37 | pub fn id(self: @This()) u4 { |
| 38 | return @intCast(u4, switch (@enumToInt(self)) { | 38 | return @truncate(u4, @enumToInt(self)); |
| 39 | 0...15 => |i| i, | ||
| 40 | 16...31 => |i| i - 16, | ||
| 41 | 32...47 => |i| i - 32, | ||
| 42 | 48...64 => |i| i - 48, | ||
| 43 | else => unreachable, | ||
| 44 | }); | ||
| 45 | } | 39 | } |
| 46 | 40 | ||
| 47 | }; | 41 | }; |