mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-21 03:28:31 +00:00
isValueValidForType can be a static member function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106278 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f627dc37bf
commit
7720cb3823
@ -1130,7 +1130,7 @@ public:
|
|||||||
}
|
}
|
||||||
bool isExactlyValue(const APFloat& V) const;
|
bool isExactlyValue(const APFloat& V) const;
|
||||||
|
|
||||||
bool isValueValidForType(EVT VT, const APFloat& Val);
|
static bool isValueValidForType(EVT VT, const APFloat& Val);
|
||||||
|
|
||||||
static bool classof(const ConstantFPSDNode *) { return true; }
|
static bool classof(const ConstantFPSDNode *) { return true; }
|
||||||
static bool classof(const SDNode *N) {
|
static bool classof(const SDNode *N) {
|
||||||
|
@ -357,7 +357,7 @@ static SDValue ExpandConstantFP(ConstantFPSDNode *CFP, bool UseCP,
|
|||||||
EVT SVT = VT;
|
EVT SVT = VT;
|
||||||
while (SVT != MVT::f32) {
|
while (SVT != MVT::f32) {
|
||||||
SVT = (MVT::SimpleValueType)(SVT.getSimpleVT().SimpleTy - 1);
|
SVT = (MVT::SimpleValueType)(SVT.getSimpleVT().SimpleTy - 1);
|
||||||
if (CFP->isValueValidForType(SVT, CFP->getValueAPF()) &&
|
if (ConstantFPSDNode::isValueValidForType(SVT, CFP->getValueAPF()) &&
|
||||||
// Only do this if the target has a native EXTLOAD instruction from
|
// Only do this if the target has a native EXTLOAD instruction from
|
||||||
// smaller type.
|
// smaller type.
|
||||||
TLI.isLoadExtLegal(ISD::EXTLOAD, SVT) &&
|
TLI.isLoadExtLegal(ISD::EXTLOAD, SVT) &&
|
||||||
|
@ -10252,8 +10252,8 @@ void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
|||||||
// 32-bit signed value
|
// 32-bit signed value
|
||||||
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
|
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
|
||||||
const ConstantInt *CI = C->getConstantIntValue();
|
const ConstantInt *CI = C->getConstantIntValue();
|
||||||
if (CI->isValueValidForType(Type::getInt32Ty(*DAG.getContext()),
|
if (ConstantInt::isValueValidForType(Type::getInt32Ty(*DAG.getContext()),
|
||||||
C->getSExtValue())) {
|
C->getSExtValue())) {
|
||||||
// Widen to 64 bits here to get it sign extended.
|
// Widen to 64 bits here to get it sign extended.
|
||||||
Result = DAG.getTargetConstant(C->getSExtValue(), MVT::i64);
|
Result = DAG.getTargetConstant(C->getSExtValue(), MVT::i64);
|
||||||
break;
|
break;
|
||||||
@ -10267,8 +10267,8 @@ void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
|||||||
// 32-bit unsigned value
|
// 32-bit unsigned value
|
||||||
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
|
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
|
||||||
const ConstantInt *CI = C->getConstantIntValue();
|
const ConstantInt *CI = C->getConstantIntValue();
|
||||||
if (CI->isValueValidForType(Type::getInt32Ty(*DAG.getContext()),
|
if (ConstantInt::isValueValidForType(Type::getInt32Ty(*DAG.getContext()),
|
||||||
C->getZExtValue())) {
|
C->getZExtValue())) {
|
||||||
Result = DAG.getTargetConstant(C->getZExtValue(), Op.getValueType());
|
Result = DAG.getTargetConstant(C->getZExtValue(), Op.getValueType());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user