Commit ae840508 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[x64] Add disassembler support for 'pause'

The 'pause' instruction is used for implementing retpolines. It is
currently being printed as 'nop', which is incorrect.

R=titzer@chromium.org

Change-Id: I134b6dae332103fd7f9b3c4e5520f0d5db06ba74
Reviewed-on: https://chromium-review.googlesource.com/1051789Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53109}
parent 7d356ac4
......@@ -2567,7 +2567,9 @@ int DisassemblerX64::InstructionDecode(v8::internal::Vector<char> out_buffer,
case 0x96:
case 0x97: {
int reg = (*data & 0x7) | (rex_b() ? 8 : 0);
if (reg == 0) {
if (group_1_prefix_ == 0xF3 && *data == 0x90) {
AppendToBuffer("pause");
} else if (reg == 0) {
AppendToBuffer("nop"); // Common name for xchg rax,rax.
} else {
AppendToBuffer("xchg%c rax,%s",
......
......@@ -955,6 +955,7 @@ TEST(DisasmX64) {
__ Nop(i);
}
__ pause();
__ ret(0);
CodeDesc desc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment