*/
// clang-format off
-const insFlags CodeGenInterface::instInfo[] =
+const insFlags CodeGenInterface::instInfo[] =
{
#define INST0(id, nm, um, mr, tt, flags) static_cast<insFlags>(flags),
#define INST1(id, nm, um, mr, tt, flags) static_cast<insFlags>(flags),
*/
// clang-format off
-const BYTE emitter::emitInsModeFmtTab[] =
+const uint8_t emitter::emitInsModeFmtTab[] =
{
#define INST0(id, nm, um, mr, tt, flags) um,
#define INST1(id, nm, um, mr, tt, flags) um,
inline size_t insCode(instruction ins)
{
// clang-format off
- const static
- size_t insCodes[] =
+ const static uint32_t insCodes[] =
{
#define INST0(id, nm, um, mr, tt, flags) mr,
#define INST1(id, nm, um, mr, tt, flags) mr,
inline size_t insCodeACC(instruction ins)
{
// clang-format off
- const static
- size_t insCodesACC[] =
+ const static uint32_t insCodesACC[] =
{
#define INST0(id, nm, um, mr, tt, flags)
#define INST1(id, nm, um, mr, tt, flags)
inline size_t insCodeRR(instruction ins)
{
// clang-format off
- const static
- size_t insCodesRR[] =
+ const static uint32_t insCodesRR[] =
{
#define INST0(id, nm, um, mr, tt, flags)
#define INST1(id, nm, um, mr, tt, flags)
}
// clang-format off
-const static
-size_t insCodesRM[] =
+const static size_t insCodesRM[] =
{
#define INST0(id, nm, um, mr, tt, flags)
#define INST1(id, nm, um, mr, tt, flags)
}
// clang-format off
-const static
-size_t insCodesMI[] =
+const static size_t insCodesMI[] =
{
#define INST0(id, nm, um, mr, tt, flags)
#define INST1(id, nm, um, mr, tt, flags)
}
// clang-format off
-const static
-size_t insCodesMR[] =
+const static uint32_t insCodesMR[] =
{
#define INST0(id, nm, um, mr, tt, flags)
#define INST1(id, nm, um, mr, tt, flags) mr,
}
// clang-format off
-const static
-insTupleType insTupleTypeInfos[] =
+const static insTupleType insTupleTypeInfos[] =
{
#define INST0(id, nm, um, mr, tt, flags) static_cast<insTupleType>(tt),
#define INST1(id, nm, um, mr, tt, flags) static_cast<insTupleType>(tt),
// clang-format off
#if defined(TARGET_XARCH)
#define HARDWARE_INTRINSIC(isa, name, size, numarg, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, category, flag) \
- {NI_##isa##_##name, #name, InstructionSet_##isa, size, numarg, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, category, static_cast<HWIntrinsicFlag>(flag)},
+ { \
+ /* name */ #name, \
+ /* flags */ static_cast<HWIntrinsicFlag>(flag), \
+ /* id */ NI_##isa##_##name, \
+ /* ins */ t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, \
+ /* isa */ InstructionSet_##isa, \
+ /* simdSize */ size, \
+ /* numArgs */ numarg, \
+ /* category */ category \
+ },
#include "hwintrinsiclistxarch.h"
#elif defined (TARGET_ARM64)
#define HARDWARE_INTRINSIC(isa, name, size, numarg, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, category, flag) \
- {NI_##isa##_##name, #name, InstructionSet_##isa, size, numarg, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, category, static_cast<HWIntrinsicFlag>(flag)},
+ { \
+ /* name */ #name, \
+ /* flags */ static_cast<HWIntrinsicFlag>(flag), \
+ /* id */ NI_##isa##_##name, \
+ /* ins */ t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, \
+ /* isa */ InstructionSet_##isa, \
+ /* simdSize */ size, \
+ /* numArgs */ numarg, \
+ /* category */ category \
+ },
#include "hwintrinsiclistarm64.h"
#else
#error Unsupported platform
#ifdef FEATURE_HW_INTRINSICS
#ifdef TARGET_XARCH
-enum HWIntrinsicCategory : unsigned int
+enum HWIntrinsicCategory : uint8_t
{
// Simple SIMD intrinsics
// - take Vector128/256<T> parameters
// - have to be addressed specially
HW_Category_Special
};
-
#elif defined(TARGET_ARM64)
-
-enum HWIntrinsicCategory : unsigned int
+enum HWIntrinsicCategory : uint8_t
{
// Most of the Arm64 intrinsic fall into SIMD category:
// - vector or scalar intrinsics that operate on one-or-many SIMD registers
// - have to be addressed specially
HW_Category_Special
};
-
#else
#error Unsupported platform
#endif
-
enum HWIntrinsicFlag : unsigned int
{
HW_Flag_NoFlag = 0,
#if defined(TARGET_XARCH)
// This mirrors the System.Runtime.Intrinsics.X86.FloatComparisonMode enumeration
-enum class FloatComparisonMode : unsigned char
+enum class FloatComparisonMode : uint8_t
{
// _CMP_EQ_OQ
OrderedEqualNonSignaling = 0,
UnorderedTrueSignaling = 31,
};
-enum class FloatRoundingMode : unsigned char
+enum class FloatRoundingMode : uint8_t
{
// _MM_FROUND_TO_NEAREST_INT
ToNearestInteger = 0x00,
struct HWIntrinsicInfo
{
- NamedIntrinsic id;
- const char* name;
- CORINFO_InstructionSet isa;
- int simdSize;
- int numArgs;
- instruction ins[10];
- HWIntrinsicCategory category;
- HWIntrinsicFlag flags;
+ // 32-bit: 36-bytes (34+2 trailing padding)
+ // 64-bit: 40-bytes (38+2 trailing padding)
+
+ const char* name; // 4 or 8-bytes
+ HWIntrinsicFlag flags; // 4-bytes
+ NamedIntrinsic id; // 2-bytes
+ uint16_t ins[10]; // 10 * 2-bytes
+ uint8_t isa; // 1-byte
+ int8_t simdSize; // 1-byte
+ int8_t numArgs; // 1-byte
+ HWIntrinsicCategory category; // 1-byte
static const HWIntrinsicInfo& lookup(NamedIntrinsic id);
static CORINFO_InstructionSet lookupIsa(NamedIntrinsic id)
{
- return lookup(id).isa;
+ uint8_t result = lookup(id).isa;
+ return static_cast<CORINFO_InstructionSet>(result);
}
#ifdef TARGET_XARCH
assert(!"Unexpected type");
return INS_invalid;
}
- return lookup(id).ins[type - TYP_BYTE];
+
+ uint16_t result = lookup(id).ins[type - TYP_BYTE];
+ return static_cast<instruction>(result);
}
static instruction lookupIns(GenTreeHWIntrinsic* intrinsicNode)
/*****************************************************************************/
// clang-format off
-enum instruction : unsigned
+enum instruction : uint32_t
{
#if defined(TARGET_XARCH)
#define INST0(id, nm, um, mr, tt, flags) INS_##id,
// Represents tupletype attribute of instruction.
// This is used in determining factor N while calculating compressed displacement in EVEX encoding
// Reference: Section 2.6.5 in Intel 64 and ia-32 architectures software developer's manual volume 2.
-enum insTupleType : uint32_t
+enum insTupleType : uint16_t
{
- INS_TT_NONE = 0x00000,
- INS_TT_FULL = 0x00001,
- INS_TT_HALF = 0x00002,
- INS_TT_IS_BROADCAST = 0x00003,
- INS_TT_FULL_MEM = 0x00010,
- INS_TT_TUPLE1_SCALAR = 0x00020,
- INS_TT_TUPLE1_FIXED = 0x00040,
- INS_TT_TUPLE2 = 0x00080,
- INS_TT_TUPLE4 = 0x00100,
- INS_TT_TUPLE8 = 0x00200,
- INS_TT_HALF_MEM = 0x00400,
- INS_TT_QUARTER_MEM = 0x00800,
- INS_TT_EIGHTH_MEM = 0x01000,
- INS_TT_MEM128 = 0x02000,
- INS_TT_MOVDDUP = 0x04000,
- INS_TT_IS_NON_BROADCAST = 0x7FFFC
+ INS_TT_NONE = 0x0000,
+ INS_TT_FULL = 0x0001,
+ INS_TT_HALF = 0x0002,
+ INS_TT_IS_BROADCAST = 0x0003,
+ INS_TT_FULL_MEM = 0x0010,
+ INS_TT_TUPLE1_SCALAR = 0x0020,
+ INS_TT_TUPLE1_FIXED = 0x0040,
+ INS_TT_TUPLE2 = 0x0080,
+ INS_TT_TUPLE4 = 0x0100,
+ INS_TT_TUPLE8 = 0x0200,
+ INS_TT_HALF_MEM = 0x0400,
+ INS_TT_QUARTER_MEM = 0x0800,
+ INS_TT_EIGHTH_MEM = 0x1000,
+ INS_TT_MEM128 = 0x2000,
+ INS_TT_MOVDDUP = 0x4000,
+ INS_TT_IS_NON_BROADCAST = 0x8000,
};
#endif