24 if (
Mappings[i].isValueEqual(Value, FeatureBits)) {
36 std::string LowerCaseName = Name.
lower();
38 if (
Mappings[i].isNameEqual(LowerCaseName, FeatureBits)) {
104 {
"iallu",
IALLU, {}},
143 {
"spsel",
SPSel, {}},
148 {
"pan",
PAN, {AArch64::HasV8_1aOps}},
254 {
"lorid_el1",
LORID_EL1, {AArch64::HasV8_1aOps}},
258 InstMappings = &MRSMappings[0];
280 {
"pan",
PAN, {AArch64::HasV8_1aOps}},
284 InstMappings = &MSRMappings[0];
405 {
"spsel",
SPSel, {}},
771 {
"pan",
PAN, {AArch64::HasV8_1aOps}},
774 {
"lorsa_el1",
LORSA_EL1, {AArch64::HasV8_1aOps}},
775 {
"lorea_el1",
LOREA_EL1, {AArch64::HasV8_1aOps}},
776 {
"lorn_el1",
LORN_EL1, {AArch64::HasV8_1aOps}},
777 {
"lorc_el1",
LORC_EL1, {AArch64::HasV8_1aOps}},
780 {
"ttbr1_el2",
TTBR1_EL2, {AArch64::HasV8_1aOps}},
785 {
"sctlr_el12",
SCTLR_EL12, {AArch64::HasV8_1aOps}},
786 {
"cpacr_el12",
CPACR_EL12, {AArch64::HasV8_1aOps}},
787 {
"ttbr0_el12",
TTBR0_EL12, {AArch64::HasV8_1aOps}},
788 {
"ttbr1_el12",
TTBR1_EL12, {AArch64::HasV8_1aOps}},
789 {
"tcr_el12",
TCR_EL12, {AArch64::HasV8_1aOps}},
790 {
"afsr0_el12",
AFSR0_EL12, {AArch64::HasV8_1aOps}},
791 {
"afsr1_el12",
AFSR1_EL12, {AArch64::HasV8_1aOps}},
792 {
"esr_el12",
ESR_EL12, {AArch64::HasV8_1aOps}},
793 {
"far_el12",
FAR_EL12, {AArch64::HasV8_1aOps}},
794 {
"mair_el12",
MAIR_EL12, {AArch64::HasV8_1aOps}},
795 {
"amair_el12",
AMAIR_EL12, {AArch64::HasV8_1aOps}},
796 {
"vbar_el12",
VBAR_EL12, {AArch64::HasV8_1aOps}},
805 {
"spsr_el12",
SPSR_EL12, {AArch64::HasV8_1aOps}},
806 {
"elr_el12",
ELR_EL12, {AArch64::HasV8_1aOps}},
812 std::string NameLower = Name.
lower();
816 if (SysRegMappings[i].isNameEqual(NameLower, FeatureBits)) {
818 return SysRegMappings[i].Value;
824 for (
unsigned i = 0; i < NumInstMappings; ++i) {
825 if (InstMappings[i].isNameEqual(NameLower, FeatureBits)) {
827 return InstMappings[i].Value;
832 Regex GenericRegPattern(
"^s([0-3])_([0-7])_c([0-9]|1[0-5])_c([0-9]|1[0-5])_([0-7])$");
835 if (!GenericRegPattern.
match(NameLower, &Ops)) {
840 uint32_t Op0 = 0, Op1 = 0, CRn = 0, CRm = 0, Op2 = 0;
842 Ops[1].getAsInteger(10, Op0);
843 Ops[2].getAsInteger(10, Op1);
844 Ops[3].getAsInteger(10, CRn);
845 Ops[4].getAsInteger(10, CRm);
846 Ops[5].getAsInteger(10, Op2);
847 Bits = (Op0 << 14) | (Op1 << 11) | (CRn << 7) | (CRm << 3) | Op2;
858 if (SysRegMappings[i].isValueEqual(Bits, FeatureBits)) {
859 return SysRegMappings[i].Name;
865 for (
unsigned i = 0; i < NumInstMappings; ++i) {
866 if (InstMappings[i].isValueEqual(Bits, FeatureBits)) {
867 return InstMappings[i].Name;
871 assert(Bits < 0x10000);
872 uint32_t Op0 = (Bits >> 14) & 0x3;
873 uint32_t Op1 = (Bits >> 11) & 0x7;
874 uint32_t CRn = (Bits >> 7) & 0xf;
875 uint32_t CRm = (Bits >> 3) & 0xf;
876 uint32_t Op2 = Bits & 0x7;
902 {
"alle2",
ALLE2, {}},
903 {
"alle3",
ALLE3, {}},
908 {
"vaae1",
VAAE1, {}},
909 {
"alle1",
ALLE1, {}},
910 {
"vale1",
VALE1, {}},
911 {
"vale2",
VALE2, {}},
912 {
"vale3",
VALE3, {}},
std::string toString(uint32_t Bits, const FeatureBitset &FeatureBits) const
static const Mapping PRFMMappings[]
static const Mapping DCMappings[]
static const Mapping DBarrierMappings[]
static const Mapping PStateMappings[]
Instances of this class can perform bidirectional mapping from random identifier strings to operand e...
static const Mapping ATMappings[]
static const AArch64NamedImmMapper::Mapping MSRMappings[]
StringRef toString(uint32_t Value, const FeatureBitset &FeatureBits, bool &Valid) const
static std::string utostr(uint64_t X, bool isNeg=false)
LLVM_CONSTEXPR size_t array_lengthof(T(&)[N])
Find the length of an array.
static const Mapping ISBMappings[]
This file declares a class to represent arbitrary precision floating point values and provide a varie...
static const Mapping ICMappings[]
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
uint32_t fromString(StringRef Name, const FeatureBitset &FeatureBits, bool &Valid) const
static const AArch64NamedImmMapper::Mapping SysRegMappings[]
uint32_t fromString(StringRef Name, const FeatureBitset &FeatureBits, bool &Valid) const
LLVM Value Representation.
static const AArch64NamedImmMapper::Mapping MRSMappings[]
bool match(StringRef String, SmallVectorImpl< StringRef > *Matches=nullptr)
matches - Match the regex against a given String.
StringRef - Represent a constant reference to a string, i.e.
std::string lower() const
static const Mapping TLBIMappings[]
bool validImm(uint32_t Value) const
Many of the instructions allow an alternative assembly form consisting of a simple immediate...