commit 24efbf5ddfd7037eb5e0ec32fe73e10631add788 (tree)
parent ad9df43e4926247cff20a9d9851fffb2a99c8a30
Author: Noam Preil <noam@pixelhero.dev>
Date: Fri, 21 Aug 2020 18:25:46 -0400
Codegen: Move REX assert to comptime
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src-self-hosted/codegen.zig b/src-self-hosted/codegen.zig
@@ -1776,7 +1776,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
/// X => extension to the SIB.index field
/// B => extension to the MODRM.rm field or the SIB.base field
fn rex(self: *Self, arg: struct { b: bool = false, w: bool = false, x: bool = false, r: bool = false }) void {
- std.debug.assert(arch == .x86_64);
+ comptime assert(arch == .x86_64);
// From section 2.2.1.2 of the manual, REX is encoded as b0100WRXB.
var value: u8 = 0x40;
if (arg.b) {