41 #ifndef __ARCH_ARM_INSTS_PREDINST_HH__
42 #define __ARCH_ARM_INSTS_PREDINST_HH__
54 static inline uint32_t
58 return rotateValue == 0 ? immValue :
59 (immValue >> rotateValue) | (immValue << (32 - rotateValue));
62 static inline uint32_t
65 uint32_t bigData = dataImm;
66 uint32_t bigCtrl = ctrlImm;
72 return bigData | (bigData << 16);
74 return (bigData << 8) | (bigData << 24);
76 return (bigData << 0) | (bigData << 8) |
77 (bigData << 16) | (bigData << 24);
80 bigCtrl = (bigCtrl << 1) | ((bigData >> 7) & 0x1);
82 return bigData << (32 - bigCtrl);
85 static inline uint64_t
87 bool isAarch64 =
false)
89 uint64_t bigData =
data;
94 bigData = (bigData << 0) | (bigData << 32);
98 bigData = (bigData << 8) | (bigData << 40);
102 bigData = (bigData << 16) | (bigData << 48);
106 bigData = (bigData << 24) | (bigData << 56);
110 bigData = (bigData << 0) | (bigData << 16) |
111 (bigData << 32) | (bigData << 48);
115 bigData = (bigData << 8) | (bigData << 24) |
116 (bigData << 40) | (bigData << 56);
119 bigData = (0xffULL << 0) | (bigData << 8) |
120 (0xffULL << 32) | (bigData << 40);
123 bigData = (0xffffULL << 0) | (bigData << 16) |
124 (0xffffULL << 32) | (bigData << 48);
129 for (
int i = 7;
i >= 0;
i--) {
131 bigData |= (0xFFULL << (
i * 8));
135 bigData = (bigData << 0) | (bigData << 8) |
136 (bigData << 16) | (bigData << 24) |
137 (bigData << 32) | (bigData << 40) |
138 (bigData << 48) | (bigData << 56);
145 bVal =
bits(bigData, 6) ? (0x1F) : (0x20);
146 bigData = (
bits(bigData, 5, 0) << 19) |
147 (bVal << 25) | (
bits(bigData, 7) << 31);
148 bigData |= (bigData << 32);
150 }
else if (isAarch64) {
151 bVal =
bits(bigData, 6) ? (0x0FF) : (0x100);
152 bigData = (
bits(bigData, 5, 0) << 48) |
153 (bVal << 54) | (
bits(bigData, 7) << 63);
168 static inline uint64_t
171 uint64_t bigData =
data;
176 bigData = (
bits(bigData, 5, 0) << 6) |
177 (repData << 12) | (
bits(~bigData, 6) << 14) |
178 (
bits(bigData, 7) << 15);
182 bigData = (
bits(bigData, 5, 0) << 19) |
183 (repData << 25) | (
bits(~bigData, 6) << 30) |
184 (
bits(bigData, 7) << 31);
188 bigData = (
bits(bigData, 5, 0) << 48) |
189 (repData << 54) | (
bits(~bigData, 6) << 62) |
190 (
bits(bigData, 7) << 63);
193 panic(
"Unrecognized FP data type");
207 "Invalid floating point data type in VFP/SIMD or SVE instruction");
247 PredOp(mnem, _machInst, __opClass),
272 PredOp(mnem, _machInst, __opClass),
291 IntRegIndex _dest, IntRegIndex _op1, uint32_t _imm,
bool _rotC) :
292 PredOp(mnem, _machInst, __opClass),
308 IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _op2,
309 int32_t _shiftAmt, ArmShiftType _shiftType) :
310 PredOp(mnem, _machInst, __opClass),
326 IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _op2,
327 IntRegIndex _shift, ArmShiftType _shiftType) :
328 PredOp(mnem, _machInst, __opClass),
349 PredOp(mnem, _machInst, __opClass),
355 flags[IsMacroop] =
true;
374 panic(
"Execute method called when it shouldn't!");
388 PredOp(mnem, _machInst, __opClass)
390 flags[IsMicroop] =
true;
396 if (
flags[IsLastMicroop])
406 #endif //__ARCH_ARM_INSTS_PREDINST_HH__