1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[MC] Add createFPImm/isFPImm/setFPImm to smooth migration from FPImm to DFPImm after D96091

This commit is contained in:
Fangrui Song 2021-02-04 20:42:35 -08:00
parent 161c766c65
commit 1c762d7312

View File

@ -100,11 +100,19 @@ public:
assert(isDFPImm() && "This is not an FP immediate");
return FPImmVal;
}
double getFPImm() const {
assert(isDFPImm() && "This is not an FP immediate");
return bit_cast<double>(FPImmVal);
}
void setDFPImm(uint64_t Val) {
assert(isDFPImm() && "This is not an FP immediate");
FPImmVal = Val;
}
void setFPImm(double Val) {
assert(isDFPImm() && "This is not an FP immediate");
FPImmVal = bit_cast<uint64_t>(Val);
}
const MCExpr *getExpr() const {
assert(isExpr() && "This is not an expression");
@ -153,6 +161,12 @@ public:
Op.FPImmVal = Val;
return Op;
}
static MCOperand createFPImm(double Val) {
MCOperand Op;
Op.Kind = kDFPImmediate;
Op.FPImmVal = bit_cast<uint64_t>(Val);
return Op;
}
static MCOperand createExpr(const MCExpr *Val) {
MCOperand Op;