summaryrefslogtreecommitdiff
path: root/src/arch/arm/insts
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:12 -0500
committerGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:12 -0500
commitb87ebf382f1c53b1b8ae58fc86d82dcc22d882d8 (patch)
tree71788b9c7d98e6068688d5ec571cd41c2a35ea59 /src/arch/arm/insts
parent7eb4d02dd9a008db32449f42037d670eab41f2c4 (diff)
downloadgem5-b87ebf382f1c53b1b8ae58fc86d82dcc22d882d8.tar.xz
ARM: Add a function to decode VFP modified immediate constants.
Diffstat (limited to 'src/arch/arm/insts')
-rw-r--r--src/arch/arm/insts/pred_inst.hh19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/arch/arm/insts/pred_inst.hh b/src/arch/arm/insts/pred_inst.hh
index 76d1029e8..b5095dcef 100644
--- a/src/arch/arm/insts/pred_inst.hh
+++ b/src/arch/arm/insts/pred_inst.hh
@@ -144,6 +144,25 @@ simd_modified_imm(bool op, uint8_t cmode, uint8_t data)
return bigData;
}
+static inline uint64_t
+vfp_modified_imm(uint8_t data, bool wide)
+{
+ uint64_t bigData = data;
+ uint64_t repData;
+ if (wide) {
+ repData = bits(data, 6) ? 0xFF : 0;
+ bigData = (bits(bigData, 5, 0) << 48) |
+ (repData << 54) | (bits(~bigData, 6) << 62) |
+ (bits(bigData, 7) << 63);
+ } else {
+ repData = bits(data, 6) ? 0x1F : 0;
+ bigData = (bits(bigData, 5, 0) << 19) |
+ (repData << 25) | (bits(~bigData, 6) << 30) |
+ (bits(bigData, 7) << 31);
+ }
+ return bigData;
+}
+
/**
* Base class for predicated integer operations.