summaryrefslogtreecommitdiff
path: root/src/arch
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
commit5a6bf8301ad933d038f87f3030b00af1d775d5c9 (patch)
tree4000aa1ae1f37490f508adfbf71c357ee76133a7 /src/arch
parent563db6cb990a0dd5442b51b507152904e7bbd152 (diff)
downloadgem5-5a6bf8301ad933d038f87f3030b00af1d775d5c9.tar.xz
ARM: Detect a bad offset field for the VFP Ldm/Stm instructions in the decoder.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arm/isa/formats/fp.isa33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/arch/arm/isa/formats/fp.isa b/src/arch/arm/isa/formats/fp.isa
index 55668e5f6..1bb15fd5b 100644
--- a/src/arch/arm/isa/formats/fp.isa
+++ b/src/arch/arm/isa/formats/fp.isa
@@ -96,20 +96,25 @@ let {{
}
break;
case 0x1:
- switch (bits(opcode, 1, 0)) {
- case 0x0:
- return new VLdmStm(machInst, rn, vd, single,
- true, false, false, offset);
- case 0x1:
- return new VLdmStm(machInst, rn, vd, single,
- true, false, true, offset);
- case 0x2:
- return new VLdmStm(machInst, rn, vd, single,
- true, true, false, offset);
- case 0x3:
- // If rn == sp, then this is called vpop.
- return new VLdmStm(machInst, rn, vd, single,
- true, true, true, offset);
+ {
+ if (offset == 0 || vd + offset > NumFloatArchRegs) {
+ break;
+ }
+ switch (bits(opcode, 1, 0)) {
+ case 0x0:
+ return new VLdmStm(machInst, rn, vd, single,
+ true, false, false, offset);
+ case 0x1:
+ return new VLdmStm(machInst, rn, vd, single,
+ true, false, true, offset);
+ case 0x2:
+ return new VLdmStm(machInst, rn, vd, single,
+ true, true, false, offset);
+ case 0x3:
+ // If rn == sp, then this is called vpop.
+ return new VLdmStm(machInst, rn, vd, single,
+ true, true, true, offset);
+ }
}
case 0x2:
if (bits(opcode, 1, 0) == 0x2) {