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 {...@@ -12475,6 +12475,7 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void {
12475 break :mnem std.meta.stringToEnum(Instruction.Mnemonic, mnem_str);12475 break :mnem std.meta.stringToEnum(Instruction.Mnemonic, mnem_str);
12476 } orelse return self.fail("invalid mnemonic: '{s}'", .{mnem_str});12476 } orelse return self.fail("invalid mnemonic: '{s}'", .{mnem_str});
12477 if (@as(?Memory.Size, switch (mnem_tag) {12477 if (@as(?Memory.Size, switch (mnem_tag) {
12478 .clflush => .byte,
12478 .fldenv, .fnstenv, .fstenv => .none,12479 .fldenv, .fnstenv, .fstenv => .none,
12479 .ldmxcsr, .stmxcsr, .vldmxcsr, .vstmxcsr => .dword,12480 .ldmxcsr, .stmxcsr, .vldmxcsr, .vstmxcsr => .dword,
12480 else => null,12481 else => null,
src/arch/x86_64/Encoding.zig+1-1
...@@ -224,7 +224,7 @@ pub const Mnemonic = enum {...@@ -224,7 +224,7 @@ pub const Mnemonic = enum {
224 // General-purpose224 // General-purpose
225 adc, add, @"and",225 adc, add, @"and",
226 bsf, bsr, bswap, bt, btc, btr, bts,226 bsf, bsr, bswap, bt, btc, btr, bts,
227 call, cbw, cdq, cdqe,227 call, cbw, cdq, cdqe, clflush,
228 cmova, cmovae, cmovb, cmovbe, cmovc, cmove, cmovg, cmovge, cmovl, cmovle, cmovna,228 cmova, cmovae, cmovb, cmovbe, cmovc, cmove, cmovg, cmovge, cmovl, cmovle, cmovna,
229 cmovnae, cmovnb, cmovnbe, cmovnc, cmovne, cmovng, cmovnge, cmovnl, cmovnle, cmovno,229 cmovnae, cmovnb, cmovnbe, cmovnc, cmovne, cmovng, cmovnge, cmovnl, cmovnle, cmovno,
230 cmovnp, cmovns, cmovnz, cmovo, cmovp, cmovpe, cmovpo, cmovs, cmovz,230 cmovnp, cmovns, cmovnz, cmovo, cmovp, cmovpe, cmovpo, cmovs, cmovz,
src/arch/x86_64/Mir.zig+2
...@@ -305,6 +305,8 @@ pub const Inst = struct {...@@ -305,6 +305,8 @@ pub const Inst = struct {
305 cdq,305 cdq,
306 /// Convert doubleword to quadword306 /// Convert doubleword to quadword
307 cdqe,307 cdqe,
308 /// Flush cache line
309 clflush,
308 /// Conditional move310 /// Conditional move
309 cmov,311 cmov,
310 /// Logical compare312 /// Logical compare
src/arch/x86_64/encodings.zig+2
...@@ -132,6 +132,8 @@ pub const table = [_]Entry{...@@ -132,6 +132,8 @@ pub const table = [_]Entry{
132 .{ .cdq, .zo, &.{ .o32 }, &.{ 0x99 }, 0, .none, .none },132 .{ .cdq, .zo, &.{ .o32 }, &.{ 0x99 }, 0, .none, .none },
133 .{ .cqo, .zo, &.{ .o64 }, &.{ 0x99 }, 0, .long, .none },133 .{ .cqo, .zo, &.{ .o64 }, &.{ 0x99 }, 0, .long, .none },
134134
135 .{ .clflush, .m, &.{ .m8 }, &.{ 0x0f, 0xae }, 7, .none, .none },
136
135 .{ .cmova, .rm, &.{ .r16, .rm16 }, &.{ 0x0f, 0x47 }, 0, .short, .none },137 .{ .cmova, .rm, &.{ .r16, .rm16 }, &.{ 0x0f, 0x47 }, 0, .short, .none },
136 .{ .cmova, .rm, &.{ .r32, .rm32 }, &.{ 0x0f, 0x47 }, 0, .none, .none },138 .{ .cmova, .rm, &.{ .r32, .rm32 }, &.{ 0x0f, 0x47 }, 0, .none, .none },
137 .{ .cmova, .rm, &.{ .r64, .rm64 }, &.{ 0x0f, 0x47 }, 0, .long, .none },139 .{ .cmova, .rm, &.{ .r64, .rm64 }, &.{ 0x0f, 0x47 }, 0, .long, .none },