Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Unified Diff: src/ia32/disasm-ia32.cc

Issue 1069683002: [ia32] Introduce BMI instructions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Align with gdb disassembler Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/disasm-ia32.cc
diff --git a/src/ia32/disasm-ia32.cc b/src/ia32/disasm-ia32.cc
index 6e5dcf45d0f1e0892155bd34bb3ee55742043818..d13127773aa9869c01fbf2e848d1af1ece8c5df0 100644
--- a/src/ia32/disasm-ia32.cc
+++ b/src/ia32/disasm-ia32.cc
@@ -299,6 +299,12 @@ class DisassemblerIA32 {
return (checked & 4) != 1;
}
+ bool vex_none() {
+ DCHECK(vex_byte0_ == 0xc4 || vex_byte0_ == 0xc5);
+ byte checked = vex_byte0_ == 0xc4 ? vex_byte2_ : vex_byte1_;
+ return (checked & 3) == 0;
+ }
+
bool vex_66() {
DCHECK(vex_byte0_ == 0xc4 || vex_byte0_ == 0xc5);
byte checked = vex_byte0_ == 0xc4 ? vex_byte2_ : vex_byte1_;
@@ -804,6 +810,11 @@ int DisassemblerIA32::AVXInstruction(byte* data) {
NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
current += PrintRightXMMOperand(current);
break;
+ case 0xf7:
+ AppendToBuffer("shlx %s,", NameOfCPURegister(regop));
+ current += PrintRightOperand(current);
+ AppendToBuffer(",%s", NameOfCPURegister(vvvv));
+ break;
default:
UnimplementedInstruction();
}
@@ -881,6 +892,99 @@ int DisassemblerIA32::AVXInstruction(byte* data) {
default:
UnimplementedInstruction();
}
+ } else if (vex_none() && vex_0f38()) {
+ int mod, regop, rm, vvvv = vex_vreg();
+ get_modrm(*current, &mod, &regop, &rm);
+ const char* mnem = "?";
+ switch (opcode) {
+ case 0xf2:
+ AppendToBuffer("andn %s,%s,", NameOfCPURegister(regop),
+ NameOfCPURegister(vvvv));
+ current += PrintRightOperand(current);
+ break;
+ case 0xf5:
+ AppendToBuffer("bzhi %s,", NameOfCPURegister(regop));
+ current += PrintRightOperand(current);
+ AppendToBuffer(",%s", NameOfCPURegister(vvvv));
+ break;
+ case 0xf7:
+ AppendToBuffer("bextr %s,", NameOfCPURegister(regop));
+ current += PrintRightOperand(current);
+ AppendToBuffer(",%s", NameOfCPURegister(vvvv));
+ break;
+ case 0xf3:
+ switch (regop) {
+ case 1:
+ mnem = "blsr";
+ break;
+ case 2:
+ mnem = "blsmsk";
+ break;
+ case 3:
+ mnem = "blsi";
+ break;
+ default:
+ UnimplementedInstruction();
+ }
+ AppendToBuffer("%s %s,", mnem, NameOfCPURegister(vvvv));
+ current += PrintRightOperand(current);
+ mnem = "?";
+ break;
+ default:
+ UnimplementedInstruction();
+ }
+ } else if (vex_f2() && vex_0f38()) {
+ int mod, regop, rm, vvvv = vex_vreg();
+ get_modrm(*current, &mod, &regop, &rm);
+ switch (opcode) {
+ case 0xf5:
+ AppendToBuffer("pdep %s,%s,", NameOfCPURegister(regop),
+ NameOfCPURegister(vvvv));
+ current += PrintRightOperand(current);
+ break;
+ case 0xf6:
+ AppendToBuffer("mulx %s,%s,", NameOfCPURegister(regop),
+ NameOfCPURegister(vvvv));
+ current += PrintRightOperand(current);
+ break;
+ case 0xf7:
+ AppendToBuffer("shrx %s,", NameOfCPURegister(regop));
+ current += PrintRightOperand(current);
+ AppendToBuffer(",%s", NameOfCPURegister(vvvv));
+ break;
+ default:
+ UnimplementedInstruction();
+ }
+ } else if (vex_f3() && vex_0f38()) {
+ int mod, regop, rm, vvvv = vex_vreg();
+ get_modrm(*current, &mod, &regop, &rm);
+ switch (opcode) {
+ case 0xf5:
+ AppendToBuffer("pext %s,%s,", NameOfCPURegister(regop),
+ NameOfCPURegister(vvvv));
+ current += PrintRightOperand(current);
+ break;
+ case 0xf7:
+ AppendToBuffer("sarx %s,", NameOfCPURegister(regop));
+ current += PrintRightOperand(current);
+ AppendToBuffer(",%s", NameOfCPURegister(vvvv));
+ break;
+ default:
+ UnimplementedInstruction();
+ }
+ } else if (vex_f2() && vex_0f3a()) {
+ int mod, regop, rm;
+ get_modrm(*current, &mod, &regop, &rm);
+ switch (opcode) {
+ case 0xf0:
+ AppendToBuffer("rorx %s,", NameOfCPURegister(regop));
+ current += PrintRightOperand(current);
+ AppendToBuffer(",%d", *current & 0x1f);
+ current += 1;
+ break;
+ default:
+ UnimplementedInstruction();
+ }
} else {
UnimplementedInstruction();
}
@@ -1900,6 +2004,24 @@ int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
get_modrm(*data, &mod, &regop, &rm);
data += PrintRightXMMOperand(data);
AppendToBuffer(",%s", NameOfXMMRegister(regop));
+ } else if (b2 == 0xB8) {
+ data += 3;
+ int mod, regop, rm;
+ get_modrm(*data, &mod, &regop, &rm);
+ AppendToBuffer("popcnt %s,", NameOfCPURegister(regop));
+ data += PrintRightOperand(data);
+ } else if (b2 == 0xBC) {
+ data += 3;
+ int mod, regop, rm;
+ get_modrm(*data, &mod, &regop, &rm);
+ AppendToBuffer("tzcnt %s,", NameOfCPURegister(regop));
+ data += PrintRightOperand(data);
+ } else if (b2 == 0xBD) {
+ data += 3;
+ int mod, regop, rm;
+ get_modrm(*data, &mod, &regop, &rm);
+ AppendToBuffer("lzcnt %s,", NameOfCPURegister(regop));
+ data += PrintRightOperand(data);
} else {
const char* mnem = "?";
switch (b2) {
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698