aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/MachineOperand.h
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-02-14 07:39:30 +0000
committerNate Begeman <natebegeman@mac.com>2008-02-14 07:39:30 +0000
commite8b7ccf0c9a06831266d690d0b10ead71e0a4ac5 (patch)
tree04c61761b6ab7c1684018a78975fb0fd4dad8a23 /include/llvm/CodeGen/MachineOperand.h
parent13daadbd256cc69cb80426f102d3637e17541e75 (diff)
downloadexternal_llvm-e8b7ccf0c9a06831266d690d0b10ead71e0a4ac5.zip
external_llvm-e8b7ccf0c9a06831266d690d0b10ead71e0a4ac5.tar.gz
external_llvm-e8b7ccf0c9a06831266d690d0b10ead71e0a4ac5.tar.bz2
Support a new type of MachineOperand, MO_FPImmediate, used for holding
FP Immediates, crazily enough git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47117 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineOperand.h')
-rw-r--r--include/llvm/CodeGen/MachineOperand.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineOperand.h b/include/llvm/CodeGen/MachineOperand.h
index 7fb2b9e..d62c8f8 100644
--- a/include/llvm/CodeGen/MachineOperand.h
+++ b/include/llvm/CodeGen/MachineOperand.h
@@ -21,6 +21,7 @@
namespace llvm {
+class ConstantFP;
class MachineBasicBlock;
class GlobalValue;
class MachineInstr;
@@ -34,6 +35,7 @@ public:
enum MachineOperandType {
MO_Register, // Register operand.
MO_Immediate, // Immediate Operand
+ MO_FPImmediate,
MO_MachineBasicBlock, // MachineBasicBlock reference
MO_FrameIndex, // Abstract Stack Frame Index
MO_ConstantPoolIndex, // Address of indexed Constant in Constant Pool
@@ -77,6 +79,7 @@ private:
/// Contents union - This contains the payload for the various operand types.
union {
MachineBasicBlock *MBB; // For MO_MachineBasicBlock.
+ ConstantFP *CFP; // For MO_FPImmediate.
int64_t ImmVal; // For MO_Immediate.
struct { // For MO_Register.
@@ -120,6 +123,7 @@ public:
///
bool isRegister() const { return OpKind == MO_Register; }
bool isImmediate() const { return OpKind == MO_Immediate; }
+ bool isFPImmediate() const { return OpKind == MO_FPImmediate; }
bool isMachineBasicBlock() const { return OpKind == MO_MachineBasicBlock; }
bool isFrameIndex() const { return OpKind == MO_FrameIndex; }
bool isConstantPoolIndex() const { return OpKind == MO_ConstantPoolIndex; }
@@ -231,6 +235,11 @@ public:
return Contents.ImmVal;
}
+ ConstantFP *getFPImm() const {
+ assert(isFPImmediate() && "Wrong MachineOperand accessor");
+ return Contents.CFP;
+ }
+
MachineBasicBlock *getMBB() const {
assert(isMachineBasicBlock() && "Wrong MachineOperand accessor");
return Contents.MBB;
@@ -313,6 +322,12 @@ public:
return Op;
}
+ static MachineOperand CreateFPImm(ConstantFP *CFP) {
+ MachineOperand Op(MachineOperand::MO_FPImmediate);
+ Op.Contents.CFP = CFP;
+ return Op;
+ }
+
static MachineOperand CreateReg(unsigned Reg, bool isDef, bool isImp = false,
bool isKill = false, bool isDead = false,
unsigned SubReg = 0) {