Index: src/ia32/disasm-ia32.cc |
diff --git a/src/ia32/disasm-ia32.cc b/src/ia32/disasm-ia32.cc |
index a87e44b3f945c4a243d0f530a6f75e39dc3e19b0..d776365b5959b2d34835bd660506afa8dda48003 100644 |
--- a/src/ia32/disasm-ia32.cc |
+++ b/src/ia32/disasm-ia32.cc |
@@ -1232,6 +1232,10 @@ static const char* F0Mnem(byte f0byte) { |
return "shrd"; // 3-operand version. |
case 0xAB: |
return "bts"; |
+ case 0xB0: |
+ return "cmpxchg_b"; |
+ case 0xB1: |
+ return "cmpxchg"; |
case 0xBC: |
return "bsf"; |
case 0xBD: |
@@ -1264,6 +1268,9 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer, |
vex_byte0_ = *data; |
vex_byte1_ = *(data + 1); |
data += 2; |
+ } else if (*data == 0xF0 /*lock*/) { |
+ AppendToBuffer("lock "); |
+ data++; |
} |
bool processed = true; // Will be set to false if the current instruction |
@@ -1496,6 +1503,18 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer, |
} else { |
AppendToBuffer(",%s,cl", NameOfCPURegister(regop)); |
} |
+ } else if (f0byte == 0xB0) { |
+ // cmpxchg_b |
+ data += 2; |
+ AppendToBuffer("%s ", f0mnem); |
+ int mod, regop, rm; |
+ get_modrm(*data, &mod, ®op, &rm); |
+ data += PrintRightOperand(data); |
+ AppendToBuffer(",%s", NameOfByteCPURegister(regop)); |
+ } else if (f0byte == 0xB1) { |
+ // cmpxchg |
+ data += 2; |
+ data += PrintOperands(f0mnem, OPER_REG_OP_ORDER, data); |
} else if (f0byte == 0xBC) { |
data += 2; |
int mod, regop, rm; |
@@ -1612,9 +1631,8 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer, |
data++; |
int mod, regop, rm; |
get_modrm(*data, &mod, ®op, &rm); |
- AppendToBuffer("xchg_w "); |
+ AppendToBuffer("xchg_w %s,", NameOfCPURegister(regop)); |
data += PrintRightOperand(data); |
- AppendToBuffer(",%s", NameOfCPURegister(regop)); |
} else if (*data == 0x89) { |
data++; |
int mod, regop, rm; |
@@ -1884,6 +1902,9 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer, |
NameOfXMMRegister(regop), |
NameOfXMMRegister(rm)); |
data++; |
+ } else if (*data == 0xB1) { |
+ data++; |
+ data += PrintOperands("cmpxchg_w", OPER_REG_OP_ORDER, data); |
} else { |
UnimplementedInstruction(); |
} |