|
LLVM
3.7.0
|
Instances of this class can perform bidirectional mapping from random identifier strings to operand encodings. More...
#include <AArch64BaseInfo.h>
Classes | |
| struct | Mapping |
Public Member Functions | |
| template<int N> | |
| AArch64NamedImmMapper (const Mapping(&Mappings)[N], uint32_t TooBigImm) | |
| StringRef | toString (uint32_t Value, const FeatureBitset &FeatureBits, bool &Valid) const |
| uint32_t | fromString (StringRef Name, const FeatureBitset &FeatureBits, bool &Valid) const |
| bool | validImm (uint32_t Value) const |
| Many of the instructions allow an alternative assembly form consisting of a simple immediate. More... | |
Protected Attributes | |
| const Mapping * | Mappings |
| size_t | NumMappings |
| uint32_t | TooBigImm |
Instances of this class can perform bidirectional mapping from random identifier strings to operand encodings.
For example "MSR" takes a named system-register which must be encoded somehow and decoded for printing. This central location means that the information for those transformations is not duplicated and remains in sync.
FIXME: currently the algorithm is a completely unoptimised linear search. Obviously this could be improved, but we would probably want to work out just how often these instructions are emitted before working on it. It might even be optimal to just reorder the tables for the common instructions rather than changing the algorithm.
Definition at line 280 of file AArch64BaseInfo.h.
|
inline |
Definition at line 306 of file AArch64BaseInfo.h.
| uint32_t AArch64NamedImmMapper::fromString | ( | StringRef | Name, |
| const FeatureBitset & | FeatureBits, | ||
| bool & | Valid | ||
| ) | const |
Definition at line 34 of file AArch64BaseInfo.cpp.
References llvm::StringRef::lower(), Mappings, NumMappings, and llvm::AArch64NamedImmMapper::Mapping::Value.
| StringRef AArch64NamedImmMapper::toString | ( | uint32_t | Value, |
| const FeatureBitset & | FeatureBits, | ||
| bool & | Valid | ||
| ) | const |
Definition at line 21 of file AArch64BaseInfo.cpp.
References Mappings, llvm::AArch64NamedImmMapper::Mapping::Name, and NumMappings.
Referenced by DecodeSystemPStateInstruction(), llvm::AArch64InstPrinter::printBarrierOption(), llvm::AArch64InstPrinter::printPrefetchOp(), and llvm::AArch64InstPrinter::printSystemPStateField().
| bool AArch64NamedImmMapper::validImm | ( | uint32_t | Value | ) | const |
Many of the instructions allow an alternative assembly form consisting of a simple immediate.
Currently the only valid forms are ranges [0, N) where N being 0 indicates no immediate syntax-form is allowed.
Definition at line 48 of file AArch64BaseInfo.cpp.
References TooBigImm.
Definition at line 321 of file AArch64BaseInfo.h.
Referenced by fromString(), and toString().
|
protected |
Definition at line 322 of file AArch64BaseInfo.h.
Referenced by fromString(), and toString().
|
protected |
Definition at line 323 of file AArch64BaseInfo.h.
Referenced by validImm().
1.8.6