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

Unified Diff: runtime/vm/disassembler_x64.cc

Issue 12207117: SSE Assembler and Disassembler support (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add tests Created 7 years, 10 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
« runtime/platform/globals.h ('K') | « runtime/vm/disassembler_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/disassembler_x64.cc
diff --git a/runtime/vm/disassembler_x64.cc b/runtime/vm/disassembler_x64.cc
index 4d150720a75f36f7e92f5855e4dd22802036fc7c..e3f1ac5bc136984ba1625ced4ba227bd04f3652f 100644
--- a/runtime/vm/disassembler_x64.cc
+++ b/runtime/vm/disassembler_x64.cc
@@ -1394,7 +1394,6 @@ int DisassemblerX64::TwoByteOpcodeInstruction(uint8_t* data) {
get_modrm(*current, &mod, &regop, &rm);
AppendToBuffer("movaps %s, ", NameOfXMMRegister(regop));
current += PrintRightXMMOperand(current);
-
} else if (opcode == 0x29) {
// movaps xmm/m128, xmm
int mod, regop, rm;
@@ -1402,7 +1401,19 @@ int DisassemblerX64::TwoByteOpcodeInstruction(uint8_t* data) {
AppendToBuffer("movaps ");
current += PrintRightXMMOperand(current);
AppendToBuffer(", %s", NameOfXMMRegister(regop));
-
+ } else if (opcode == 0x11) {
+ // movups xmm/m128, xmm
+ int mod, regop, rm;
+ get_modrm(*current, &mod, &regop, &rm);
+ AppendToBuffer("movups ");
+ current += PrintRightXMMOperand(current);
+ AppendToBuffer(", %s", NameOfXMMRegister(regop));
+ } else if (opcode == 0x10) {
+ // movups xmm, xmm/m128
+ int mod, regop, rm;
+ get_modrm(*current, &mod, &regop, &rm);
+ AppendToBuffer("movups %s, ", NameOfXMMRegister(regop));
+ current += PrintRightXMMOperand(current);
} else if (opcode == 0xA2 || opcode == 0x31) {
// RDTSC or CPUID
AppendToBuffer("%s", mnemonic);
@@ -1414,13 +1425,68 @@ int DisassemblerX64::TwoByteOpcodeInstruction(uint8_t* data) {
byte_size_operand_ = idesc.byte_size_operation;
current += PrintOperands(idesc.mnem, idesc.op_order_, current);
- } else if (opcode == 0x57) {
- // xorps xmm, xmm/m128
+ } else if (opcode == 0x51 || opcode == 0x52 || opcode == 0x53 ||
+ opcode == 0x54 || opcode == 0x56 || opcode == 0x57 ||
+ opcode == 0x58 || opcode == 0x59 || opcode == 0x5C ||
+ opcode == 0x5D || opcode == 0x5E || opcode == 0x5F) {
+ const char* mnemonic = NULL;
+ switch (opcode) {
+ case 0x51:
+ mnemonic = "sqrtps";
+ break;
srdjan 2013/02/12 19:06:35 Strange 'break' indent. Instead of switch, why no
Cutch 2013/02/12 22:34:27 Cleaned up.
+ case 0x52:
+ mnemonic = "rsqrtps";
+ break;
+ case 0x53:
+ mnemonic = "rcpps";
+ break;
+ case 0x54:
+ mnemonic = "andps";
+ break;
+ case 0x56:
+ mnemonic = "orps";
+ break;
+ case 0x57:
+ mnemonic = "xorps";
+ break;
+ case 0x58:
+ mnemonic = "addps";
+ break;
+ case 0x59:
+ mnemonic = "mulps";
+ break;
+ case 0x5C:
+ mnemonic = "subps";
+ break;
+ case 0x5D:
+ mnemonic = "minps";
+ break;
+ case 0x5E:
+ mnemonic = "divps";
+ break;
+ case 0x5F:
+ mnemonic = "maxps";
+ break;
+ default:
+ UNREACHABLE();
+ break;
+ }
int mod, regop, rm;
get_modrm(*current, &mod, &regop, &rm);
- AppendToBuffer("xorps %s, ", NameOfXMMRegister(regop));
+ AppendToBuffer("%s %s, ", mnemonic, NameOfXMMRegister(regop));
current += PrintRightXMMOperand(current);
-
+ } else if (opcode == 0xC2 || opcode == 0xC6) {
+ int mod, regop, rm;
+ get_modrm(*current, &mod, &regop, &rm);
+ if (opcode == 0xC2) {
+ AppendToBuffer("cmpps %s, ", NameOfXMMRegister(regop));
+ } else {
+ ASSERT(opcode == 0xC6);
+ AppendToBuffer("shufps %s, ", NameOfXMMRegister(regop));
+ }
+ current += PrintRightXMMOperand(current);
+ AppendToBuffer(" [%x]", *current);
+ current++;
} else if ((opcode & 0xF0) == 0x80) {
// Jcc: Conditional jump (branch).
current = data + JumpConditional(data);
« runtime/platform/globals.h ('K') | « runtime/vm/disassembler_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698