Commit 5082a1d9 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[ia32] Consolidate rounding opcodes in disasm

Bug: v8:10933

Change-Id: I71869306fded6212a231f9825a6b7091f5f6f19d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2383070Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70203}
parent 82aa10fe
...@@ -2152,37 +2152,21 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer, ...@@ -2152,37 +2152,21 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
} }
} else if (*data == 0x3A) { } else if (*data == 0x3A) {
data++; data++;
if (*data == 0x08) { if (*data >= 0x08 && *data <= 0x0B) {
data++; const char* const pseudo_op[] = {
int mod, regop, rm; "roundps",
get_modrm(*data, &mod, &regop, &rm); "roundpd",
int8_t imm8 = static_cast<int8_t>(data[1]); "roundss",
AppendToBuffer("roundps %s,%s,%d", NameOfXMMRegister(regop), "roundsd",
NameOfXMMRegister(rm), static_cast<int>(imm8)); };
data += 2; byte op = *data;
} else if (*data == 0x09) {
data++;
int mod, regop, rm;
get_modrm(*data, &mod, &regop, &rm);
int8_t imm8 = static_cast<int8_t>(data[1]);
AppendToBuffer("roundpd %s,%s,%d", NameOfXMMRegister(regop),
NameOfXMMRegister(rm), static_cast<int>(imm8));
data += 2;
} else if (*data == 0x0A) {
data++;
int mod, regop, rm;
get_modrm(*data, &mod, &regop, &rm);
int8_t imm8 = static_cast<int8_t>(data[1]);
AppendToBuffer("roundss %s,%s,%d", NameOfXMMRegister(regop),
NameOfXMMRegister(rm), static_cast<int>(imm8));
data += 2;
} else if (*data == 0x0B) {
data++; data++;
int mod, regop, rm; int mod, regop, rm;
get_modrm(*data, &mod, &regop, &rm); get_modrm(*data, &mod, &regop, &rm);
int8_t imm8 = static_cast<int8_t>(data[1]); int8_t imm8 = static_cast<int8_t>(data[1]);
AppendToBuffer("roundsd %s,%s,%d", NameOfXMMRegister(regop), AppendToBuffer("%s %s,%s,%d", pseudo_op[op - 0x08],
NameOfXMMRegister(rm), static_cast<int>(imm8)); NameOfXMMRegister(regop), NameOfXMMRegister(rm),
static_cast<int>(imm8));
data += 2; data += 2;
} else if (*data == 0x0E) { } else if (*data == 0x0E) {
data++; data++;
......
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