Commit ca7a4387 authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Improve support for vmrs/vmsr in ARM disassembler. This is a commit of...

Improve support for vmrs/vmsr in ARM disassembler.  This is a commit of http://codereview.chromium.org/4904001 for Martyn Capewell.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5824 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 583198eb
......@@ -1046,6 +1046,7 @@ int Decoder::DecodeType7(Instr* instr) {
// Dd = vdiv(Dn, Dm)
// vcmp(Dd, Dm)
// vmrs
// vmsr
// Dd = vsqrt(Dm)
void Decoder::DecodeTypeVFP(Instr* instr) {
ASSERT((instr->TypeField() == 7) && (instr->Bit(24) == 0x0) );
......@@ -1111,16 +1112,22 @@ void Decoder::DecodeTypeVFP(Instr* instr) {
if ((instr->VCField() == 0x0) &&
(instr->VAField() == 0x0)) {
DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(instr);
} else if ((instr->VLField() == 0x1) &&
(instr->VCField() == 0x0) &&
} else if ((instr->VCField() == 0x0) &&
(instr->VAField() == 0x7) &&
(instr->Bits(19, 16) == 0x1)) {
if (instr->Bits(15, 12) == 0xF)
if (instr->VLField() == 0) {
if (instr->Bits(15, 12) == 0xF) {
Format(instr, "vmsr'cond FPSCR, APSR");
} else {
Format(instr, "vmsr'cond FPSCR, 'rt");
}
} else {
if (instr->Bits(15, 12) == 0xF) {
Format(instr, "vmrs'cond APSR, FPSCR");
else
Unknown(instr); // Not used by V8.
} else {
Unknown(instr); // Not used by V8.
Format(instr, "vmrs'cond 'rt, FPSCR");
}
}
}
}
}
......
......@@ -87,9 +87,9 @@ bool DisassembleAndCompare(byte* pc, const char* compare_string) {
#define COMPARE(asm_, compare_string) \
{ \
int pc_offset = assm.pc_offset(); \
byte *pc = &buffer[pc_offset]; \
byte *progcounter = &buffer[pc_offset]; \
assm.asm_; \
if (!DisassembleAndCompare(pc, compare_string)) failure = true; \
if (!DisassembleAndCompare(progcounter, compare_string)) failure = true; \
}
......@@ -499,6 +499,19 @@ TEST(Vfp) {
"ed811b01 vstr d1, [r1 + 4*1]");
COMPARE(vstr(d15, r10, 1020),
"ed8afbff vstr d15, [r10 + 4*255]");
COMPARE(vmsr(r5),
"eee15a10 vmsr FPSCR, r5");
COMPARE(vmsr(r10, pl),
"5ee1aa10 vmsrpl FPSCR, r10");
COMPARE(vmsr(pc),
"eee1fa10 vmsr FPSCR, APSR");
COMPARE(vmrs(r5),
"eef15a10 vmrs r5, FPSCR");
COMPARE(vmrs(r10, ge),
"aef1aa10 vmrsge r10, FPSCR");
COMPARE(vmrs(pc),
"eef1fa10 vmrs APSR, FPSCR");
}
VERIFY_RUN();
......
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