Merge V8 5.3.332.45. DO NOT MERGE
Test: Manual
FPIIM-449
Change-Id: Id3254828b068abdea3cb10442e0172a8c9a98e03
(cherry picked from commit 13e2dadd00298019ed862f2b2fc5068bba730bcf)
diff --git a/src/x64/disasm-x64.cc b/src/x64/disasm-x64.cc
index 7126b89..d679898 100644
--- a/src/x64/disasm-x64.cc
+++ b/src/x64/disasm-x64.cc
@@ -142,19 +142,18 @@
SHORT_IMMEDIATE_INSTR
};
-
enum Prefixes {
ESCAPE_PREFIX = 0x0F,
OPERAND_SIZE_OVERRIDE_PREFIX = 0x66,
ADDRESS_SIZE_OVERRIDE_PREFIX = 0x67,
VEX3_PREFIX = 0xC4,
VEX2_PREFIX = 0xC5,
+ LOCK_PREFIX = 0xF0,
REPNE_PREFIX = 0xF2,
REP_PREFIX = 0xF3,
REPEQ_PREFIX = REP_PREFIX
};
-
struct InstructionDesc {
const char* mnem;
InstructionType type;
@@ -1514,7 +1513,16 @@
if (operand_size_ == 0x66) {
// 0x66 0x0F prefix.
int mod, regop, rm;
- if (opcode == 0x3A) {
+ if (opcode == 0x38) {
+ byte third_byte = *current;
+ current = data + 3;
+ if (third_byte == 0x40) {
+ // pmulld xmm, xmm/m128
+ get_modrm(*current, &mod, ®op, &rm);
+ AppendToBuffer("pmulld %s,", NameOfXMMRegister(regop));
+ current += PrintRightXMMOperand(current);
+ }
+ } else if (opcode == 0x3A) {
byte third_byte = *current;
current = data + 3;
if (third_byte == 0x17) {
@@ -1537,11 +1545,18 @@
AppendToBuffer(",0x%x", (*current) & 3);
current += 1;
} else if (third_byte == 0x16) {
- get_modrm(*current, &mod, &rm, ®op);
+ get_modrm(*current, &mod, ®op, &rm);
AppendToBuffer("pextrd "); // reg/m32, xmm, imm8
current += PrintRightOperand(current);
AppendToBuffer(",%s,%d", NameOfXMMRegister(regop), (*current) & 3);
current += 1;
+ } else if (third_byte == 0x21) {
+ get_modrm(*current, &mod, ®op, &rm);
+ // insertps xmm, xmm/m32, imm8
+ AppendToBuffer("insertps %s,", NameOfXMMRegister(regop));
+ current += PrintRightXMMOperand(current);
+ AppendToBuffer(",0x%x", (*current) & 3);
+ current += 1;
} else if (third_byte == 0x22) {
get_modrm(*current, &mod, ®op, &rm);
AppendToBuffer("pinsrd "); // xmm, reg/m32, imm8
@@ -1597,6 +1612,11 @@
} else if (opcode == 0x50) {
AppendToBuffer("movmskpd %s,", NameOfCPURegister(regop));
current += PrintRightXMMOperand(current);
+ } else if (opcode == 0x70) {
+ AppendToBuffer("pshufd %s,", NameOfXMMRegister(regop));
+ current += PrintRightXMMOperand(current);
+ AppendToBuffer(",0x%x", *current);
+ current += 1;
} else if (opcode == 0x72) {
current += 1;
AppendToBuffer("%s %s,%d", (regop == 6) ? "pslld" : "psrld",
@@ -1607,6 +1627,8 @@
AppendToBuffer("%s %s,%d", (regop == 6) ? "psllq" : "psrlq",
NameOfXMMRegister(rm), *current & 0x7f);
current += 1;
+ } else if (opcode == 0xB1) {
+ current += PrintOperands("cmpxchg", OPER_REG_OP_ORDER, current);
} else {
const char* mnemonic = "?";
if (opcode == 0x54) {
@@ -1615,6 +1637,8 @@
mnemonic = "orpd";
} else if (opcode == 0x57) {
mnemonic = "xorpd";
+ } else if (opcode == 0x5B) {
+ mnemonic = "cvtps2dq";
} else if (opcode == 0x2E) {
mnemonic = "ucomisd";
} else if (opcode == 0x2F) {
@@ -1625,6 +1649,12 @@
mnemonic = "punpckldq";
} else if (opcode == 0x6A) {
mnemonic = "punpckhdq";
+ } else if (opcode == 0xF4) {
+ mnemonic = "pmuludq";
+ } else if (opcode == 0xFA) {
+ mnemonic = "psubd";
+ } else if (opcode == 0xFE) {
+ mnemonic = "paddd";
} else {
UnimplementedInstruction();
}
@@ -1766,6 +1796,19 @@
} else {
UnimplementedInstruction();
}
+ } else if (opcode == 0x10 || opcode == 0x11) {
+ // movups xmm, xmm/m128
+ // movups xmm/m128, xmm
+ int mod, regop, rm;
+ get_modrm(*current, &mod, ®op, &rm);
+ AppendToBuffer("movups ");
+ if (opcode == 0x11) {
+ current += PrintRightXMMOperand(current);
+ AppendToBuffer(",%s", NameOfXMMRegister(regop));
+ } else {
+ AppendToBuffer("%s,", NameOfXMMRegister(regop));
+ current += PrintRightXMMOperand(current);
+ }
} else if (opcode == 0x1F) {
// NOP
int mod, regop, rm;
@@ -1812,29 +1855,28 @@
byte_size_operand_ = idesc.byte_size_operation;
current += PrintOperands(idesc.mnem, idesc.op_order_, current);
- } else if (opcode >= 0x53 && opcode <= 0x5F) {
+ } else if (opcode >= 0x51 && opcode <= 0x5F) {
const char* const pseudo_op[] = {
- "rcpps",
- "andps",
- "andnps",
- "orps",
- "xorps",
- "addps",
- "mulps",
- "cvtps2pd",
- "cvtdq2ps",
- "subps",
- "minps",
- "divps",
- "maxps",
+ "sqrtps", "rsqrtps", "rcpps", "andps", "andnps",
+ "orps", "xorps", "addps", "mulps", "cvtps2pd",
+ "cvtdq2ps", "subps", "minps", "divps", "maxps",
};
int mod, regop, rm;
get_modrm(*current, &mod, ®op, &rm);
- AppendToBuffer("%s %s,",
- pseudo_op[opcode - 0x53],
+ AppendToBuffer("%s %s,", pseudo_op[opcode - 0x51],
NameOfXMMRegister(regop));
current += PrintRightXMMOperand(current);
+ } else if (opcode == 0xC2) {
+ // cmpps xmm, xmm/m128, imm8
+ int mod, regop, rm;
+ get_modrm(*current, &mod, ®op, &rm);
+ const char* const pseudo_op[] = {"cmpeqps", "cmpltps", "cmpleps",
+ "cmpunordps", "cmpneqps", "cmpnltps",
+ "cmpnleps", "cmpordps"};
+ AppendToBuffer("%s %s,%s", pseudo_op[current[1]], NameOfXMMRegister(regop),
+ NameOfXMMRegister(rm));
+ current += 2;
} else if (opcode == 0xC6) {
// shufps xmm, xmm/m128, imm8
int mod, regop, rm;
@@ -1843,7 +1885,6 @@
current += PrintRightXMMOperand(current);
AppendToBuffer(", %d", (*current) & 3);
current += 1;
-
} else if (opcode == 0x50) {
// movmskps reg, xmm
int mod, regop, rm;
@@ -1884,6 +1925,12 @@
current += PrintRightOperand(current);
} else if (opcode == 0x0B) {
AppendToBuffer("ud2");
+ } else if (opcode == 0xB0 || opcode == 0xB1) {
+ // CMPXCHG.
+ if (opcode == 0xB0) {
+ byte_size_operand_ = true;
+ }
+ current += PrintOperands(mnemonic, OPER_REG_OP_ORDER, current);
} else {
UnimplementedInstruction();
}
@@ -1926,6 +1973,9 @@
return "shrd";
case 0xAF:
return "imul";
+ case 0xB0:
+ case 0xB1:
+ return "cmpxchg";
case 0xB6:
return "movzxb";
case 0xB7:
@@ -1963,6 +2013,8 @@
if (rex_w()) AppendToBuffer("REX.W ");
} else if ((current & 0xFE) == 0xF2) { // Group 1 prefix (0xF2 or 0xF3).
group_1_prefix_ = current;
+ } else if (current == LOCK_PREFIX) {
+ AppendToBuffer("lock ");
} else if (current == VEX3_PREFIX) {
vex_byte0_ = current;
vex_byte1_ = *(data + 1);
@@ -2427,7 +2479,7 @@
const char* NameConverter::NameOfAddress(byte* addr) const {
- v8::internal::SNPrintF(tmp_buffer_, "%p", addr);
+ v8::internal::SNPrintF(tmp_buffer_, "%p", static_cast<void*>(addr));
return tmp_buffer_.start();
}
@@ -2494,7 +2546,7 @@
buffer[0] = '\0';
byte* prev_pc = pc;
pc += d.InstructionDecode(buffer, pc);
- fprintf(f, "%p", prev_pc);
+ fprintf(f, "%p", static_cast<void*>(prev_pc));
fprintf(f, " ");
for (byte* bp = prev_pc; bp < pc; bp++) {