mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-23 05:29:23 +00:00
enforce the proper range for the i386 N constraint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35319 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7cd5e07f3d
commit
188b9fe834
@ -4544,16 +4544,17 @@ isOperandValidForConstraint(SDOperand Op, char Constraint, SelectionDAG &DAG) {
|
||||
switch (Constraint) {
|
||||
default: break;
|
||||
case 'I':
|
||||
if (isa<ConstantSDNode>(Op)) {
|
||||
unsigned Value = cast<ConstantSDNode>(Op)->getValue();
|
||||
if (Value <= 31)
|
||||
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
|
||||
if (C->getValue() <= 31)
|
||||
return Op;
|
||||
else
|
||||
return SDOperand(0,0);
|
||||
} else {
|
||||
return SDOperand(0,0);
|
||||
}
|
||||
break;
|
||||
return SDOperand(0,0);
|
||||
case 'N':
|
||||
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
|
||||
if (C->getValue() <= 255)
|
||||
return Op;
|
||||
}
|
||||
return SDOperand(0,0);
|
||||
case 'i':
|
||||
// Literal immediates are always ok.
|
||||
if (isa<ConstantSDNode>(Op)) return Op;
|
||||
|
Loading…
x
Reference in New Issue
Block a user