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];
64 "' is not a recognized ABI for this target");
68 "32-bit ABIs are not supported for 64-bit targets");
72 "64-bit ABIs are not supported for 32-bit targets");
74 if (ABIName.
ends_with(
'f') && !FeatureBits[RISCV::FeatureStdExtF]) {
76 "hard-float 'f' ABI can't be used for a target that doesn't "
77 "support the F instruction set extension");
79 if (ABIName.
ends_with(
'd') && !FeatureBits[RISCV::FeatureStdExtD]) {
81 "hard-float 'd' ABI can't be used for a target that doesn't "
82 "support the D instruction set extension");
84 if (!IsRV64 && IsRVE && !IsXCheriot && TargetABI !=
ABI_ILP32E &&
88 if (!IsRV64 && IsRVE && IsXCheriot && TargetABI !=
ABI_CHERIOT &&
99 FeatureBits[RISCV::FeatureStdExtD])
147 if (TT.isArch64Bit() && !FeatureBits[RISCV::Feature64Bit])
149 if (!TT.isArch64Bit() && !FeatureBits[RISCV::Feature32Bit])
151 if (FeatureBits[RISCV::Feature32Bit] &&
152 FeatureBits[RISCV::Feature64Bit])
159 unsigned XLen = FeatureBits[RISCV::Feature64Bit] ? 64 : 32;
160 std::vector<std::string> FeatureVector;
163 if (FeatureBits[Feature.Value] &&
165 FeatureVector.push_back(std::string(
"+") + Feature.key());
173#define GEN_UNCOMPRESS_INSTR
174#define GEN_COMPRESS_INSTR
175#include "RISCVGenCompressInstEmitter.inc"
179 return compressInst(OutInst,
MI, STI);
184 return uncompressInst(OutInst,
MI, STI);
189 {0b01101111, 0b00}, {0b01110000, 0b00}, {0b01110111, 0b00},
190 {0b01111000, 0b00}, {0b01111011, 0b00}, {0b01111100, 0b00},
191 {0b01111101, 0b00}, {0b01111101, 0b01}, {0b01111101, 0b10},
192 {0b01111101, 0b11}, {0b01111110, 0b00}, {0b01111110, 0b01},
193 {0b01111110, 0b10}, {0b01111110, 0b11}, {0b01111111, 0b00},
194 {0b01111111, 0b01}, {0b01111111, 0b10}, {0b01111111, 0b11},
195 {0b10000000, 0b00}, {0b10000000, 0b01}, {0b10000000, 0b10},
196 {0b10000001, 0b00}, {0b10000010, 0b00}, {0b10000011, 0b00},
197 {0b10000110, 0b00}, {0b10000111, 0b00}, {0b10001110, 0b00},
198 {0b10001111, 0b00}, {0b11111111, 0b00}, {0b11111111, 0b10},
205 "Unexpected semantics");
220 if (
Imm.extractBitsAsZExtValue(21, 0) != 0)
223 bool Sign =
Imm.extractBitsAsZExtValue(1, 31);
224 uint8_t Mantissa =
Imm.extractBitsAsZExtValue(2, 21);
225 uint8_t Exp =
Imm.extractBitsAsZExtValue(8, 23);
229 EMI->second != Mantissa)
258 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.
bool ends_with(StringRef Suffix) const
Check if this string ends with the given Suffix.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Triple - Helper class for working with autoconf configuration names.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
This class implements an extremely fast bulk output stream that can only output to a stream.
ABI getTargetABI(StringRef ABIName)
Expected< 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.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
static constexpr std::pair< uint8_t, uint8_t > LoadFP32ImmArr[]
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.