Commit 63925e50 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Add missing case for shr in IA-32 disassembler

Review URL: http://codereview.chromium.org/397024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3316 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 459e4c6b
......@@ -272,6 +272,17 @@ class DisassemblerIA32 {
};
enum ShiftOpcodeExtension {
kROL = 0,
kROR = 1,
kRCL = 2,
kRCR = 3,
kSHL = 4,
KSHR = 5,
kSAR = 7
};
const char* NameOfCPURegister(int reg) const {
return converter_.NameOfCPURegister(reg);
}
......@@ -536,31 +547,22 @@ int DisassemblerIA32::D1D3C1Instruction(byte* data) {
int num_bytes = 2;
if (mod == 3) {
const char* mnem = NULL;
switch (regop) {
case kROL: mnem = "rol"; break;
case kROR: mnem = "ror"; break;
case kRCL: mnem = "rcl"; break;
case kSHL: mnem = "shl"; break;
case KSHR: mnem = "shr"; break;
case kSAR: mnem = "sar"; break;
default: UnimplementedInstruction();
}
if (op == 0xD1) {
imm8 = 1;
switch (regop) {
case edx: mnem = "rcl"; break;
case edi: mnem = "sar"; break;
case esp: mnem = "shl"; break;
default: UnimplementedInstruction();
}
} else if (op == 0xC1) {
imm8 = *(data+2);
num_bytes = 3;
switch (regop) {
case edx: mnem = "rcl"; break;
case esp: mnem = "shl"; break;
case ebp: mnem = "shr"; break;
case edi: mnem = "sar"; break;
default: UnimplementedInstruction();
}
} else if (op == 0xD3) {
switch (regop) {
case esp: mnem = "shl"; break;
case ebp: mnem = "shr"; break;
case edi: mnem = "sar"; break;
default: UnimplementedInstruction();
}
// Shift/rotate by cl.
}
ASSERT_NE(NULL, mnem);
AppendToBuffer("%s %s,", mnem, NameOfCPURegister(rm));
......
......@@ -201,6 +201,7 @@ TEST(DisasmIa320) {
__ shl(edx, 6);
__ shl_cl(edx);
__ shrd(edx, Operand(ebx, ecx, times_4, 10000));
__ shr(edx, 1);
__ shr(edx, 7);
__ shr_cl(edx);
......
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