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,
}
} else if (*data == 0x3A) {
data++;
if (*data == 0x08) {
data++;
int mod, regop, rm;
get_modrm(*data, &mod, &regop, &rm);
int8_t imm8 = static_cast<int8_t>(data[1]);
AppendToBuffer("roundps %s,%s,%d", NameOfXMMRegister(regop),
NameOfXMMRegister(rm), static_cast<int>(imm8));
data += 2;
} 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) {
if (*data >= 0x08 && *data <= 0x0B) {
const char* const pseudo_op[] = {
"roundps",
"roundpd",
"roundss",
"roundsd",
};
byte op = *data;
data++;
int mod, regop, rm;
get_modrm(*data, &mod, &regop, &rm);
int8_t imm8 = static_cast<int8_t>(data[1]);
AppendToBuffer("roundsd %s,%s,%d", NameOfXMMRegister(regop),
NameOfXMMRegister(rm), static_cast<int>(imm8));
AppendToBuffer("%s %s,%s,%d", pseudo_op[op - 0x08],
NameOfXMMRegister(regop), NameOfXMMRegister(rm),
static_cast<int>(imm8));
data += 2;
} else if (*data == 0x0E) {
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