summaryrefslogtreecommitdiff
path: root/src/arch/arm/isa/formats
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:17 -0500
committerGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:17 -0500
commit22d1a84509dec6544bd91e63597b1b2274c590cc (patch)
treebd525d9bee85a3732a3ab31b8d6c7dd8f801cf4a /src/arch/arm/isa/formats
parent0e556e9dfbd9a3b3f06a023d4edf3b3678fd0a40 (diff)
downloadgem5-22d1a84509dec6544bd91e63597b1b2274c590cc.tar.xz
ARM: Move some miscellaneous instructions out of the decoder to share with thumb.
Diffstat (limited to 'src/arch/arm/isa/formats')
-rw-r--r--src/arch/arm/isa/formats/data.isa50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/arch/arm/isa/formats/data.isa b/src/arch/arm/isa/formats/data.isa
index e97769835..a567a92b4 100644
--- a/src/arch/arm/isa/formats/data.isa
+++ b/src/arch/arm/isa/formats/data.isa
@@ -1073,6 +1073,56 @@ def format Thumb16AddSp() {{
'''
}};
+def format ArmMisc() {{
+ decode_block = '''
+ {
+ const uint32_t unrotated = bits(machInst, 7, 0);
+ const uint32_t rotation = (bits(machInst, 11, 8) << 1);
+ const uint32_t imm = rotate_imm(unrotated, rotation);
+ const uint8_t byteMask = bits(machInst, 19, 16);
+ switch (OPCODE) {
+ case 0x8:
+ return new MovImm(machInst, (IntRegIndex)(uint32_t)RD,
+ (IntRegIndex)INTREG_ZERO,
+ bits(machInst, 11, 0) | (bits(machInst, 19, 16) << 12),
+ false);
+ case 0x9:
+ if (RN == 0) {
+ switch (IMM) {
+ case 0x0:
+ return new NopInst(machInst);
+#if FULL_SYSTEM
+ case 0x1:
+ return new YieldInst(machInst);
+ case 0x2:
+ return new WfeInst(machInst);
+ case 0x3:
+ return new WfiInst(machInst);
+ case 0x4:
+ return new SevInst(machInst);
+#endif
+ default:
+ return new Unknown(machInst);
+ }
+ } else {
+ return new MsrCpsrImm(machInst, imm, byteMask);
+ }
+ case 0xa:
+ {
+ const uint32_t timm = (bits(machInst, 19, 16) << 12) |
+ bits(machInst, 11, 0);
+ return new MovtImm(machInst, (IntRegIndex)(uint32_t)RD,
+ (IntRegIndex)(uint32_t)RD, timm, true);
+ }
+ case 0xb:
+ return new MsrSpsrImm(machInst, imm, byteMask);
+ default:
+ return new Unknown(machInst);
+ }
+ }
+ '''
+}};
+
def format Thumb16Misc() {{
decode_block = '''
{