authorgravatar for david@vortan.devDavid Rubin <david@vortan.dev> 2024-02-05 17:05:20-08:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-02-06 07:08:16-05:00
log3069669bc13450988d58d650c82289ba796ab966
treeecc1d67993871173436fb7f91287ca01fcb569a6
parent0c8072506883db21d5f8e3e7e7cb45b36d496f28

add the `clflush` mnem


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

src/arch/x86_64/CodeGen.zig+1
......@@ -12475,6 +12475,7 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void {
1247512475 break :mnem std.meta.stringToEnum(Instruction.Mnemonic, mnem_str);
1247612476 } orelse return self.fail("invalid mnemonic: '{s}'", .{mnem_str});
1247712477 if (@as(?Memory.Size, switch (mnem_tag) {
12478 .clflush => .byte,
1247812479 .fldenv, .fnstenv, .fstenv => .none,
1247912480 .ldmxcsr, .stmxcsr, .vldmxcsr, .vstmxcsr => .dword,
1248012481 else => null,
src/arch/x86_64/Encoding.zig+1-1
......@@ -224,7 +224,7 @@ pub const Mnemonic = enum {
224224 // General-purpose
225225 adc, add, @"and",
226226 bsf, bsr, bswap, bt, btc, btr, bts,
227 call, cbw, cdq, cdqe,
227 call, cbw, cdq, cdqe, clflush,
228228 cmova, cmovae, cmovb, cmovbe, cmovc, cmove, cmovg, cmovge, cmovl, cmovle, cmovna,
229229 cmovnae, cmovnb, cmovnbe, cmovnc, cmovne, cmovng, cmovnge, cmovnl, cmovnle, cmovno,
230230 cmovnp, cmovns, cmovnz, cmovo, cmovp, cmovpe, cmovpo, cmovs, cmovz,
src/arch/x86_64/Mir.zig+2
......@@ -305,6 +305,8 @@ pub const Inst = struct {
305305 cdq,
306306 /// Convert doubleword to quadword
307307 cdqe,
308 /// Flush cache line
309 clflush,
308310 /// Conditional move
309311 cmov,
310312 /// Logical compare
src/arch/x86_64/encodings.zig+2
......@@ -132,6 +132,8 @@ pub const table = [_]Entry{
132132 .{ .cdq, .zo, &.{ .o32 }, &.{ 0x99 }, 0, .none, .none },
133133 .{ .cqo, .zo, &.{ .o64 }, &.{ 0x99 }, 0, .long, .none },
134134
135 .{ .clflush, .m, &.{ .m8 }, &.{ 0x0f, 0xae }, 7, .none, .none },
136
135137 .{ .cmova, .rm, &.{ .r16, .rm16 }, &.{ 0x0f, 0x47 }, 0, .short, .none },
136138 .{ .cmova, .rm, &.{ .r32, .rm32 }, &.{ 0x0f, 0x47 }, 0, .none, .none },
137139 .{ .cmova, .rm, &.{ .r64, .rm64 }, &.{ 0x0f, 0x47 }, 0, .long, .none },