pred_inst.hh (12616:4b463b4dc098) | pred_inst.hh (13120:690a0db8e58b) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2010, 2012-2013 ARM Limited | 2 * Copyright (c) 2010, 2012-2013, 2017-2018 ARM Limited |
3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 142 unchanged lines hidden (view full) --- 153 M5_FALLTHROUGH; 154 default: 155 immValid = false; 156 break; 157 } 158 return bigData; 159} 160 | 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 142 unchanged lines hidden (view full) --- 153 M5_FALLTHROUGH; 154 default: 155 immValid = false; 156 break; 157 } 158 return bigData; 159} 160 |
161/** Floating point data types. */ 162enum class FpDataType { Fp16, Fp32, Fp64 }; 163 |
|
161static inline uint64_t | 164static inline uint64_t |
162vfp_modified_imm(uint8_t data, bool wide) | 165vfp_modified_imm(uint8_t data, FpDataType dtype) |
163{ 164 uint64_t bigData = data; 165 uint64_t repData; | 166{ 167 uint64_t bigData = data; 168 uint64_t repData; |
166 if (wide) { 167 repData = bits(data, 6) ? 0xFF : 0; 168 bigData = (bits(bigData, 5, 0) << 48) | 169 (repData << 54) | (bits(~bigData, 6) << 62) | 170 (bits(bigData, 7) << 63); 171 } else { | 169 switch (dtype) { 170 case FpDataType::Fp16: 171 repData = bits(data, 6) ? 0x3 : 0; 172 bigData = (bits(bigData, 5, 0) << 6) | 173 (repData << 12) | (bits(~bigData, 6) << 14) | 174 (bits(bigData, 7) << 15); 175 break; 176 case FpDataType::Fp32: |
172 repData = bits(data, 6) ? 0x1F : 0; 173 bigData = (bits(bigData, 5, 0) << 19) | 174 (repData << 25) | (bits(~bigData, 6) << 30) | 175 (bits(bigData, 7) << 31); | 177 repData = bits(data, 6) ? 0x1F : 0; 178 bigData = (bits(bigData, 5, 0) << 19) | 179 (repData << 25) | (bits(~bigData, 6) << 30) | 180 (bits(bigData, 7) << 31); |
181 break; 182 case FpDataType::Fp64: 183 repData = bits(data, 6) ? 0xFF : 0; 184 bigData = (bits(bigData, 5, 0) << 48) | 185 (repData << 54) | (bits(~bigData, 6) << 62) | 186 (bits(bigData, 7) << 63); 187 break; 188 default: 189 assert(0); |
|
176 } 177 return bigData; 178} 179 | 190 } 191 return bigData; 192} 193 |
194static inline FpDataType 195decode_fp_data_type(uint8_t encoding) 196{ 197 switch (encoding) { 198 case 1: return FpDataType::Fp16; 199 case 2: return FpDataType::Fp32; 200 case 3: return FpDataType::Fp64; 201 default: 202 panic( 203 "Invalid floating point data type in VFP/SIMD or SVE instruction"); 204 } 205} |
|
180 181/** 182 * Base class for predicated integer operations. 183 */ 184class PredOp : public ArmStaticInst 185{ 186 protected: 187 --- 187 unchanged lines hidden --- | 206 207/** 208 * Base class for predicated integer operations. 209 */ 210class PredOp : public ArmStaticInst 211{ 212 protected: 213 --- 187 unchanged lines hidden --- |