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

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

Issue 1776933003: [arm] Basic simulation of msr and mrs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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/arm/assembler-arm.cc ('k') | src/arm/simulator-arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/disasm-arm.cc
diff --git a/src/arm/disasm-arm.cc b/src/arm/disasm-arm.cc
index 9258703fbcae0a1fc3bc73010f19b3510aca354c..a559bcafbcbadaddb6390eff93280e9743d64856 100644
--- a/src/arm/disasm-arm.cc
+++ b/src/arm/disasm-arm.cc
@@ -604,6 +604,26 @@ int Decoder::FormatOption(Instruction* instr, const char* format) {
Print("s");
}
return 4;
+ } else if (format[1] == 'p') {
+ if (format[8] == '_') { // 'spec_reg_fields
+ DCHECK(STRING_STARTS_WITH(format, "spec_reg_fields"));
+ Print("_");
+ int mask = instr->Bits(19, 16);
+ if (mask == 0) Print("(none)");
+ if ((mask & 0x8) != 0) Print("f");
+ if ((mask & 0x4) != 0) Print("s");
+ if ((mask & 0x2) != 0) Print("x");
+ if ((mask & 0x1) != 0) Print("c");
+ return 15;
+ } else { // 'spec_reg
+ DCHECK(STRING_STARTS_WITH(format, "spec_reg"));
+ if (instr->Bit(22) == 0) {
+ Print("CPSR");
+ } else {
+ Print("SPSR");
+ }
+ return 8;
+ }
}
// 's: S field of data processing instructions
if (instr->HasS()) {
@@ -822,7 +842,13 @@ void Decoder::DecodeType01(Instruction* instr) {
return;
}
} else if ((type == 0) && instr->IsMiscType0()) {
- if (instr->Bits(22, 21) == 1) {
+ if ((instr->Bits(27, 23) == 2) && (instr->Bits(21, 20) == 2) &&
+ (instr->Bits(15, 4) == 0xf00)) {
+ Format(instr, "msr'cond 'spec_reg'spec_reg_fields, 'rm");
+ } else if ((instr->Bits(27, 23) == 2) && (instr->Bits(21, 20) == 0) &&
+ (instr->Bits(11, 0) == 0)) {
+ Format(instr, "mrs'cond 'rd, 'spec_reg");
+ } else if (instr->Bits(22, 21) == 1) {
switch (instr->BitField(7, 4)) {
case BX:
Format(instr, "bx'cond 'rm");
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/arm/simulator-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698