#ifndef LLVM_MC_MCINST_H
#define LLVM_MC_MCINST_H
-#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/System/DataTypes.h"
+#include "llvm/Support/DataTypes.h"
namespace llvm {
class raw_ostream;
union {
unsigned RegVal;
int64_t ImmVal;
+ double FPImmVal;
const MCExpr *ExprVal;
};
- // This can't go in the union due to the non-trivial copy constructor
- // of APFloat. It's still only valid for Kind == kFPImmediate, though.
- APFloat FPImmVal;
public:
MCOperand() : Kind(kInvalid), FPImmVal(0.0) {}
ImmVal = Val;
}
- const APFloat &getFPImm() const {
+ double getFPImm() const {
assert(isFPImm() && "This is not an FP immediate");
return FPImmVal;
}
- void setFPImm(const APFloat &Val) {
+ void setFPImm(double Val) {
assert(isFPImm() && "This is not an FP immediate");
FPImmVal = Val;
}
Op.ImmVal = Val;
return Op;
}
- static MCOperand CreateFPImm(const APFloat &Val) {
+ static MCOperand CreateFPImm(double Val) {
MCOperand Op;
Op.Kind = kFPImmediate;
Op.FPImmVal = Val;
StringRef Separator = " ") const;
};
+inline raw_ostream& operator<<(raw_ostream &OS, const MCOperand &MO) {
+ MO.print(OS, 0);
+ return OS;
+}
+
+inline raw_ostream& operator<<(raw_ostream &OS, const MCInst &MI) {
+ MI.print(OS, 0);
+ return OS;
+}
} // end namespace llvm