From b87ebf382f1c53b1b8ae58fc86d82dcc22d882d8 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 2 Jun 2010 12:58:12 -0500 Subject: ARM: Add a function to decode VFP modified immediate constants. --- src/arch/arm/insts/pred_inst.hh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src') 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. -- cgit v1.2.3