mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-16 20:17:05 +03:00
Use static constexpr for RegTraits to make it possible to use asmjit in CLR environment (fixes #386)
This commit is contained in:
committed by
GitHub
parent
5af57595a9
commit
0c03ed2f74
@@ -1082,19 +1082,19 @@ template<> \
|
||||
struct RegTraits<REG_TYPE> { \
|
||||
typedef REG RegT; \
|
||||
\
|
||||
enum : uint32_t { \
|
||||
kValid = uint32_t(true), \
|
||||
kCount = uint32_t(COUNT), \
|
||||
kType = uint32_t(REG_TYPE), \
|
||||
kGroup = uint32_t(GROUP), \
|
||||
kSize = uint32_t(SIZE), \
|
||||
kTypeId = uint32_t(TYPE_ID), \
|
||||
static constexpr uint32_t kValid = 1; \
|
||||
static constexpr uint32_t kCount = COUNT; \
|
||||
static constexpr RegType kType = REG_TYPE; \
|
||||
static constexpr RegGroup kGroup = GROUP; \
|
||||
static constexpr uint32_t kSize = SIZE; \
|
||||
static constexpr TypeId kTypeId = TYPE_ID; \
|
||||
\
|
||||
static constexpr uint32_t kSignature = \
|
||||
(OperandSignature::fromOpType(OperandType::kReg) | \
|
||||
OperandSignature::fromRegType(kType) | \
|
||||
OperandSignature::fromRegGroup(kGroup) | \
|
||||
OperandSignature::fromSize(kSize)).bits(); \
|
||||
\
|
||||
kSignature = (OperandSignature::fromOpType(OperandType::kReg) | \
|
||||
OperandSignature::fromRegType(REG_TYPE) | \
|
||||
OperandSignature::fromRegGroup(GROUP) | \
|
||||
OperandSignature::fromSize(kSize)).bits(), \
|
||||
}; \
|
||||
}
|
||||
|
||||
//! Adds constructors and member functions to a class that implements abstract register. Abstract register is register
|
||||
@@ -1135,12 +1135,10 @@ public: \
|
||||
//! signature.
|
||||
#define ASMJIT_DEFINE_FINAL_REG(REG, BASE, TRAITS) \
|
||||
public: \
|
||||
enum : uint32_t { \
|
||||
kThisType = TRAITS::kType, \
|
||||
kThisGroup = TRAITS::kGroup, \
|
||||
kThisSize = TRAITS::kSize, \
|
||||
kSignature = TRAITS::kSignature \
|
||||
}; \
|
||||
static constexpr RegType kThisType = TRAITS::kType; \
|
||||
static constexpr RegGroup kThisGroup = TRAITS::kGroup; \
|
||||
static constexpr uint32_t kThisSize = TRAITS::kSize; \
|
||||
static constexpr uint32_t kSignature = TRAITS::kSignature; \
|
||||
\
|
||||
ASMJIT_DEFINE_ABSTRACT_REG(REG, BASE) \
|
||||
\
|
||||
|
||||
Reference in New Issue
Block a user