summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h')
-rw-r--r--llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h b/llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h
index 30e475e80a01..cf078df9609a 100644
--- a/llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h
+++ b/llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h
@@ -13,6 +13,7 @@
#ifndef LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
#define LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
+#include "RISCVRegisterInfo.h"
#include "MCTargetDesc/RISCVMCTargetDesc.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
@@ -47,20 +48,26 @@ enum {
InstFormatMask = 31
};
+// RISC-V Specific Machine Operand Flags
enum {
- MO_None,
- MO_CALL,
- MO_PLT,
- MO_LO,
- MO_HI,
- MO_PCREL_LO,
- MO_PCREL_HI,
- MO_GOT_HI,
- MO_TPREL_LO,
- MO_TPREL_HI,
- MO_TPREL_ADD,
- MO_TLS_GOT_HI,
- MO_TLS_GD_HI,
+ MO_None = 0,
+ MO_CALL = 1,
+ MO_PLT = 2,
+ MO_LO = 3,
+ MO_HI = 4,
+ MO_PCREL_LO = 5,
+ MO_PCREL_HI = 6,
+ MO_GOT_HI = 7,
+ MO_TPREL_LO = 8,
+ MO_TPREL_HI = 9,
+ MO_TPREL_ADD = 10,
+ MO_TLS_GOT_HI = 11,
+ MO_TLS_GD_HI = 12,
+
+ // Used to differentiate between target-specific "direct" flags and "bitmask"
+ // flags. A machine operand can only have one "direct" flag, but can have
+ // multiple "bitmask" flags.
+ MO_DIRECT_FLAG_MASK = 15
};
} // namespace RISCVII
@@ -195,6 +202,9 @@ enum ABI {
ABI computeTargetABI(const Triple &TT, FeatureBitset FeatureBits,
StringRef ABIName);
+// Returns the register used to hold the stack pointer after realignment.
+Register getBPReg();
+
} // namespace RISCVABI
namespace RISCVFeatures {