summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:01 -0500
committerGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:01 -0500
commita86491fbf27588356b8a4463d967b6e6358d83cb (patch)
tree10227ba2d9df13c0ad7467c2ef1eae6728fa6d76
parentdc8af1b211f6619788dd78009a2025171041275b (diff)
downloadgem5-a86491fbf27588356b8a4463d967b6e6358d83cb.tar.xz
ARM: Decode 16 bit thumb PC relative memory instructions.
-rw-r--r--src/arch/arm/isa/decoder/thumb.isa2
-rw-r--r--src/arch/arm/isa/formats/mem.isa10
2 files changed, 11 insertions, 1 deletions
diff --git a/src/arch/arm/isa/decoder/thumb.isa b/src/arch/arm/isa/decoder/thumb.isa
index 580232b1d..56dbcfe28 100644
--- a/src/arch/arm/isa/decoder/thumb.isa
+++ b/src/arch/arm/isa/decoder/thumb.isa
@@ -89,7 +89,7 @@
0xc, 0xd: WarnUnimpl::bx();
0xe, 0xf: WarnUnimpl::blx(); //register
}
- 0x2, 0x3: WarnUnimpl::ldr();
+ 0x2, 0x3: Thumb16MemLit::thumb16MemLit();
default: Thumb16MemReg::thumb16MemReg();
}
0x3, 0x4: Thumb16MemImm::thumb16MemImm();
diff --git a/src/arch/arm/isa/formats/mem.isa b/src/arch/arm/isa/formats/mem.isa
index edefb3325..2935890c2 100644
--- a/src/arch/arm/isa/formats/mem.isa
+++ b/src/arch/arm/isa/formats/mem.isa
@@ -450,6 +450,16 @@ def format Thumb16MemImm() {{
decode_block = decode % classNames
}};
+def format Thumb16MemLit() {{
+ decode_block = '''
+ {
+ const uint32_t rt = bits(machInst, 10, 8);
+ const uint32_t imm8 = bits(machInst, 7, 0);
+ return new %s(machInst, rt, INTREG_PC, true, imm8 << 2);
+ }
+ ''' % loadImmClassName(False, True, False)
+}};
+
def format ArmLoadMemory(memacc_code, ea_code = {{ EA = Rn + disp; }},
mem_flags = [], inst_flags = []) {{
ea_code = ArmGenericCodeSubs(ea_code)