LLVM: include/llvm/MC/MCRegister.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_MC_MCREGISTER_H
10#define LLVM_MC_MCREGISTER_H
11
14#include
15#include
16
17namespace llvm {
18
19
20
22
23
24
25
26
27
28
29
30enum class MCRegUnit : unsigned;
31
34
36 return static_cast<unsigned>(Unit);
37 }
38};
39
40
43 unsigned Reg;
44
45public:
46 constexpr MCRegister(unsigned Val = 0) : Reg(Val) {}
47
48
49
50
51
52
53
54
55
56
57
58 static_assert(std::numeric_limits<decltype(Reg)>::max() >= 0xFFFFFFFF,
59 "Reg isn't large enough to hold full range.");
63
64
65
69
70
71
73
74 constexpr operator unsigned() const { return Reg; }
75
76
81
82 constexpr unsigned id() const { return Reg; }
83
85
86
88 return Reg == Other.Reg;
89 }
91 return Reg != Other.Reg;
92 }
93
94
95
96
101
108};
109
110
125
129}
130
131#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines DenseMapInfo traits for DenseMap.
Wrapper class representing physical registers. Should be passed by value.
Definition MCRegister.h:41
constexpr bool isValid() const
Definition MCRegister.h:84
static constexpr unsigned LastPhysicalReg
Definition MCRegister.h:62
static constexpr unsigned FirstPhysicalReg
Definition MCRegister.h:61
constexpr bool operator==(const MCRegister &Other) const
Comparisons between register objects.
Definition MCRegister.h:87
constexpr bool operator!=(MCPhysReg Other) const
Definition MCRegister.h:105
static constexpr unsigned NoRegister
Definition MCRegister.h:60
constexpr bool operator!=(int Other) const
Definition MCRegister.h:100
static constexpr bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
Definition MCRegister.h:66
constexpr MCRegister(unsigned Val=0)
Definition MCRegister.h:46
static MCRegister from(unsigned Val)
Check the provided unsigned value is a valid MCRegister.
Definition MCRegister.h:77
constexpr bool operator==(unsigned Other) const
Comparisons against register constants.
Definition MCRegister.h:97
constexpr bool operator==(int Other) const
Definition MCRegister.h:99
friend hash_code hash_value(const MCRegister &)
Definition MCRegister.h:126
constexpr bool operator!=(const MCRegister &Other) const
Definition MCRegister.h:90
constexpr bool isPhysical() const
Return true if the specified register number is in the physical register namespace.
Definition MCRegister.h:72
constexpr bool operator==(MCPhysReg Other) const
Definition MCRegister.h:102
constexpr bool operator!=(unsigned Other) const
Definition MCRegister.h:98
constexpr unsigned id() const
Definition MCRegister.h:82
An opaque object representing a hash code.
This is an optimization pass for GlobalISel generic memory operations.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
hash_code hash_value(const FixedPointSemantics &Val)
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
Definition MCRegister.h:21
static bool isEqual(const MCRegister &LHS, const MCRegister &RHS)
Definition MCRegister.h:121
static MCRegister getTombstoneKey()
Definition MCRegister.h:115
static unsigned getHashValue(const MCRegister &Val)
Definition MCRegister.h:118
static MCRegister getEmptyKey()
Definition MCRegister.h:112
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition MCRegister.h:32
unsigned operator()(MCRegUnit Unit) const
Definition MCRegister.h:35
MCRegUnit argument_type
Definition MCRegister.h:33