25#define GET_SysRegsList_IMPL
26#include "RISCVGenSearchableTables.inc"
30#define GET_RISCVOpcodesList_IMPL
31#include "RISCVGenSearchableTables.inc"
36#define GET_RISCVVInversePseudosTable_IMPL
37#include "RISCVGenSearchableTables.inc"
41#define GET_RISCVVSSEGTable_IMPL
42#define GET_RISCVVLSEGTable_IMPL
43#define GET_RISCVVLXSEGTable_IMPL
44#define GET_RISCVVSXSEGTable_IMPL
45#define GET_RISCVVLETable_IMPL
46#define GET_RISCVVSETable_IMPL
47#define GET_RISCVVLXTable_IMPL
48#define GET_RISCVVSXTable_IMPL
49#define GET_RISCVNDSVLNTable_IMPL
50#include "RISCVGenSearchableTables.inc"
58 bool IsRV64 = TT.isArch64Bit();
59 bool IsRVE = FeatureBits[RISCV::FeatureStdExtE];
60 bool IsXCheriot = FeatureBits[RISCV::FeatureVendorXCheriot];
65 <<
"' is not a recognized ABI for this target (ignoring target-abi)\n";
66 }
else if (ABIName.
starts_with(
"ilp32") && IsRV64) {
67 errs() <<
"32-bit ABIs are not supported for 64-bit targets (ignoring "
70 }
else if (ABIName.
starts_with(
"lp64") && !IsRV64) {
71 errs() <<
"64-bit ABIs are not supported for 32-bit targets (ignoring "
74 }
else if (!IsRV64 && IsRVE && !IsXCheriot && TargetABI !=
ABI_ILP32E &&
78 <<
"Only the ilp32e ABI is supported for RV32E (ignoring target-abi)\n";
80 }
else if (!IsRV64 && IsRVE && IsXCheriot && TargetABI !=
ABI_CHERIOT &&
82 errs() <<
"Only the cheriot ABI is supported for XCheriot (ignoring "
85 }
else if (IsRV64 && IsRVE && TargetABI !=
ABI_LP64E &&
89 <<
"Only the lp64e ABI is supported for RV64E (ignoring target-abi)\n";
95 FeatureBits[RISCV::FeatureStdExtD])
143 if (TT.isArch64Bit() && !FeatureBits[RISCV::Feature64Bit])
145 if (!TT.isArch64Bit() && !FeatureBits[RISCV::Feature32Bit])
147 if (FeatureBits[RISCV::Feature32Bit] &&
148 FeatureBits[RISCV::Feature64Bit])
155 unsigned XLen = FeatureBits[RISCV::Feature64Bit] ? 64 : 32;
156 std::vector<std::string> FeatureVector;
159 if (FeatureBits[Feature.Value] &&
161 FeatureVector.push_back(std::string(
"+") + Feature.key());
169#define GEN_UNCOMPRESS_INSTR
170#define GEN_COMPRESS_INSTR
171#include "RISCVGenCompressInstEmitter.inc"
175 return compressInst(OutInst,
MI, STI);
180 return uncompressInst(OutInst,
MI, STI);
185 {0b01101111, 0b00}, {0b01110000, 0b00}, {0b01110111, 0b00},
186 {0b01111000, 0b00}, {0b01111011, 0b00}, {0b01111100, 0b00},
187 {0b01111101, 0b00}, {0b01111101, 0b01}, {0b01111101, 0b10},
188 {0b01111101, 0b11}, {0b01111110, 0b00}, {0b01111110, 0b01},
189 {0b01111110, 0b10}, {0b01111110, 0b11}, {0b01111111, 0b00},
190 {0b01111111, 0b01}, {0b01111111, 0b10}, {0b01111111, 0b11},
191 {0b10000000, 0b00}, {0b10000000, 0b01}, {0b10000000, 0b10},
192 {0b10000001, 0b00}, {0b10000010, 0b00}, {0b10000011, 0b00},
193 {0b10000110, 0b00}, {0b10000111, 0b00}, {0b10001110, 0b00},
194 {0b10001111, 0b00}, {0b11111111, 0b00}, {0b11111111, 0b10},
201 "Unexpected semantics");
216 if (
Imm.extractBitsAsZExtValue(21, 0) != 0)
219 bool Sign =
Imm.extractBitsAsZExtValue(1, 31);
220 uint8_t Mantissa =
Imm.extractBitsAsZExtValue(2, 21);
221 uint8_t Exp =
Imm.extractBitsAsZExtValue(8, 23);
225 EMI->second != Mantissa)
254 uint32_t I = Sign << 31 | Exp << 23 | Mantissa << 21;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static const fltSemantics & IEEEsingle()
static const fltSemantics & IEEEdouble()
static constexpr roundingMode rmNearestTiesToEven
static const fltSemantics & IEEEhalf()
opStatus
IEEE-754R 7: Default exception handling.
LLVM_ABI opStatus convert(const fltSemantics &ToSemantics, roundingMode RM, bool *losesInfo)
const fltSemantics & getSemantics() const
APInt bitcastToAPInt() const
bool isSmallestNormalized() const
Class for arbitrary precision integers.
Tagged union holding either a T or a Error.
Container class for subtarget features.
Instances of this class represent a single low-level machine instruction.
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
const Triple & getTargetTriple() const
const FeatureBitset & getFeatureBits() const
ArrayRef< SubtargetFeatureKV > getAllProcessorFeatures() const
Return processor features.
static LLVM_ABI bool isSupportedExtensionFeature(StringRef Ext)
static LLVM_ABI llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseFeatures(unsigned XLen, const std::vector< std::string > &Features)
Parse RISC-V ISA info from feature vector.
Represent a constant reference to a string, i.e.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
constexpr bool empty() const
Check if the string is empty.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Triple - Helper class for working with autoconf configuration names.
This class implements an extremely fast bulk output stream that can only output to a stream.
ABI getTargetABI(StringRef ABIName)
ABI computeTargetABI(const MCSubtargetInfo &STI, StringRef ABIName)
void validate(const Triple &TT, const FeatureBitset &FeatureBits)
llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseFeatureBits(const MCSubtargetInfo &STI)
int getLoadFPImm(APFloat FPImm)
getLoadFPImm - Return a 5-bit binary encoding of the floating-point immediate value.
float getFPImm(unsigned Imm)
bool uncompress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI)
bool compress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI)
void printRegList(unsigned RlistEncode, raw_ostream &OS)
This is an optimization pass for GlobalISel generic memory operations.
static constexpr std::pair< uint8_t, uint8_t > LoadFP32ImmArr[]
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
To bit_cast(const From &from) noexcept
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.