41 #ifndef __ARCH_ARM_INSTS_PREDINST_HH__
42 #define __ARCH_ARM_INSTS_PREDINST_HH__
56 static inline uint32_t
60 return rotateValue == 0 ? immValue :
61 (immValue >> rotateValue) | (immValue << (32 - rotateValue));
64 static inline uint32_t
67 uint32_t bigData = dataImm;
68 uint32_t bigCtrl = ctrlImm;
74 return bigData | (bigData << 16);
76 return (bigData << 8) | (bigData << 24);
78 return (bigData << 0) | (bigData << 8) |
79 (bigData << 16) | (bigData << 24);
82 bigCtrl = (bigCtrl << 1) | ((bigData >> 7) & 0x1);
84 return bigData << (32 - bigCtrl);
87 static inline uint64_t
89 bool isAarch64 =
false)
91 uint64_t bigData =
data;
96 bigData = (bigData << 0) | (bigData << 32);
100 bigData = (bigData << 8) | (bigData << 40);
104 bigData = (bigData << 16) | (bigData << 48);
108 bigData = (bigData << 24) | (bigData << 56);
112 bigData = (bigData << 0) | (bigData << 16) |
113 (bigData << 32) | (bigData << 48);
117 bigData = (bigData << 8) | (bigData << 24) |
118 (bigData << 40) | (bigData << 56);
121 bigData = (0xffULL << 0) | (bigData << 8) |
122 (0xffULL << 32) | (bigData << 40);
125 bigData = (0xffffULL << 0) | (bigData << 16) |
126 (0xffffULL << 32) | (bigData << 48);
131 for (
int i = 7;
i >= 0;
i--) {
133 bigData |= (0xFFULL << (
i * 8));
137 bigData = (bigData << 0) | (bigData << 8) |
138 (bigData << 16) | (bigData << 24) |
139 (bigData << 32) | (bigData << 40) |
140 (bigData << 48) | (bigData << 56);
147 bVal =
bits(bigData, 6) ? (0x1F) : (0x20);
148 bigData = (
bits(bigData, 5, 0) << 19) |
149 (bVal << 25) | (
bits(bigData, 7) << 31);
150 bigData |= (bigData << 32);
152 }
else if (isAarch64) {
153 bVal =
bits(bigData, 6) ? (0x0FF) : (0x100);
154 bigData = (
bits(bigData, 5, 0) << 48) |
155 (bVal << 54) | (
bits(bigData, 7) << 63);
170 static inline uint64_t
173 uint64_t bigData =
data;
178 bigData = (
bits(bigData, 5, 0) << 6) |
179 (repData << 12) | (
bits(~bigData, 6) << 14) |
180 (
bits(bigData, 7) << 15);
184 bigData = (
bits(bigData, 5, 0) << 19) |
185 (repData << 25) | (
bits(~bigData, 6) << 30) |
186 (
bits(bigData, 7) << 31);
190 bigData = (
bits(bigData, 5, 0) << 48) |
191 (repData << 54) | (
bits(~bigData, 6) << 62) |
192 (
bits(bigData, 7) << 63);
195 panic(
"Unrecognized FP data type");
209 "Invalid floating point data type in VFP/SIMD or SVE instruction");
249 PredOp(mnem, _machInst, __opClass),
274 PredOp(mnem, _machInst, __opClass),
293 IntRegIndex _dest, IntRegIndex _op1, uint32_t _imm,
bool _rotC) :
294 PredOp(mnem, _machInst, __opClass),
310 IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _op2,
311 int32_t _shiftAmt, ArmShiftType _shiftType) :
312 PredOp(mnem, _machInst, __opClass),
328 IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _op2,
329 IntRegIndex _shift, ArmShiftType _shiftType) :
330 PredOp(mnem, _machInst, __opClass),
351 PredOp(mnem, _machInst, __opClass),
357 flags[IsMacroop] =
true;
376 panic(
"Execute method called when it shouldn't!");
390 PredOp(mnem, _machInst, __opClass)
392 flags[IsMicroop] =
true;
399 if (
flags[IsLastMicroop])
409 if (
flags[IsLastMicroop])
420 #endif //__ARCH_ARM_INSTS_PREDINST_HH__