| ... | ... | @@ -13619,25 +13619,26 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void { |
| 13619 | 13619 | label_gop.value_ptr.target = @intCast(self.mir_instructions.len); |
| 13620 | 13620 | } else continue; |
| 13621 | 13621 | |
| 13622 | | var mnem_size: ?Memory.Size = null; |
| 13623 | | const mnem_tag = mnem: { |
| 13624 | | mnem_size = if (mem.endsWith(u8, mnem_str, "b")) |
| 13625 | | .byte |
| 13626 | | else if (mem.endsWith(u8, mnem_str, "w")) |
| 13627 | | .word |
| 13628 | | else if (mem.endsWith(u8, mnem_str, "l")) |
| 13629 | | .dword |
| 13630 | | else if (mem.endsWith(u8, mnem_str, "q")) |
| 13631 | | .qword |
| 13632 | | else if (mem.endsWith(u8, mnem_str, "t")) |
| 13633 | | .tbyte |
| 13634 | | else |
| 13635 | | break :mnem null; |
| 13636 | | break :mnem std.meta.stringToEnum(Instruction.Mnemonic, mnem_str[0 .. mnem_str.len - 1]); |
| 13637 | | } orelse mnem: { |
| 13622 | var mnem_size: ?Memory.Size = if (mem.endsWith(u8, mnem_str, "b")) |
| 13623 | .byte |
| 13624 | else if (mem.endsWith(u8, mnem_str, "w")) |
| 13625 | .word |
| 13626 | else if (mem.endsWith(u8, mnem_str, "l")) |
| 13627 | .dword |
| 13628 | else if (mem.endsWith(u8, mnem_str, "q") and |
| 13629 | (std.mem.indexOfScalar(u8, "vp", mnem_str[0]) == null or !mem.endsWith(u8, mnem_str, "dq"))) |
| 13630 | .qword |
| 13631 | else if (mem.endsWith(u8, mnem_str, "t")) |
| 13632 | .tbyte |
| 13633 | else |
| 13634 | null; |
| 13635 | const mnem_tag = while (true) break std.meta.stringToEnum( |
| 13636 | Instruction.Mnemonic, |
| 13637 | mnem_str[0 .. mnem_str.len - @intFromBool(mnem_size != null)], |
| 13638 | ) orelse if (mnem_size) |_| { |
| 13638 | 13639 | mnem_size = null; |
| 13639 | | break :mnem std.meta.stringToEnum(Instruction.Mnemonic, mnem_str); |
| 13640 | | } orelse return self.fail("invalid mnemonic: '{s}'", .{mnem_str}); |
| 13640 | continue; |
| 13641 | } else return self.fail("invalid mnemonic: '{s}'", .{mnem_str}); |
| 13641 | 13642 | if (@as(?Memory.Size, switch (mnem_tag) { |
| 13642 | 13643 | .clflush => .byte, |
| 13643 | 13644 | .fldenv, .fnstenv, .fstenv => .none, |