14 #ifndef CS_AARCH64_ADDRESSINGMODES_H
15 #define CS_AARCH64_ADDRESSINGMODES_H
20 #include "../../MathExtras.h"
71 switch ((Imm >> 6) & 0x7) {
121 return ((elt & 1) << (
size-1)) | (elt >> 1);
130 unsigned N = (
val >> 12) & 1;
131 unsigned immr = (
val >> 6) & 0x3f;
132 unsigned imms =
val & 0x3f;
139 unsigned R = immr & (
size - 1);
140 unsigned S = imms & (
size - 1);
142 uint64_t pattern = (1ULL << (
S + 1)) - 1;
143 for (
i = 0;
i <
R; ++
i)
147 while (
size != regSize) {
148 pattern |= (pattern <<
size);
164 unsigned N = (
val >> 12) & 1;
165 unsigned imms =
val & 0x3f;
167 if (regSize == 32 &&
N != 0)
173 S = imms & (
size - 1);
191 uint8_t Sign = (Imm >> 7) & 0x1;
192 uint8_t Exp = (Imm >> 4) & 0x7;
201 FPUnion.I |= ((
uint32_t)Sign) << 31;
202 FPUnion.I |= ((Exp & 0x4) != 0 ? 0 : 1) << 30;
203 FPUnion.I |= ((Exp & 0x4) != 0 ? 0x1f : 0) << 25;
204 FPUnion.I |= (Exp & 0x3) << 23;
205 FPUnion.I |= Mantissa << 19;
216 static const uint32_t lookup[16] = {
217 0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff,
218 0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff,
219 0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff,
220 0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff
222 return lookup[Imm & 0x0f] | ((
uint64_t)lookup[Imm >> 4] << 32);
static unsigned AArch64_AM_getShiftValue(unsigned Imm)
getShiftValue - Extract the shift value.
static uint64_t ror(uint64_t elt, unsigned size)
static const char * AArch64_AM_getShiftExtendName(AArch64_AM_ShiftExtendType ST)
getShiftName - Get the string encoding for the shift type.
static uint64_t AArch64_AM_decodeLogicalImmediate(uint64_t val, unsigned regSize)
static uint64_t AArch64_AM_decodeAdvSIMDModImmType10(uint8_t Imm)
static AArch64_AM_ShiftExtendType AArch64_AM_getExtendType(unsigned Imm)
getExtendType - Extract the extend type for operands of arithmetic ops.
AArch64_AM_ShiftExtendType
AArch64_AM - AArch64 Addressing Mode Stuff.
@ AArch64_AM_InvalidShiftExtend
static AArch64_AM_ShiftExtendType AArch64_AM_getShiftType(unsigned Imm)
getShiftType - Extract the shift type.
static AArch64_AM_ShiftExtendType AArch64_AM_getArithExtendType(unsigned Imm)
static bool AArch64_AM_isValidDecodeLogicalImmediate(uint64_t val, unsigned regSize)
static unsigned AArch64_AM_getArithShiftValue(unsigned Imm)
getArithShiftValue - get the arithmetic shift value.
static float AArch64_AM_getFPImmFloat(unsigned Imm)
static int countLeadingZeros(ut64 x)