mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
fix subtle bugs in inline asm operand selection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37065 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -4725,18 +4725,19 @@ isOperandValidForConstraint(SDOperand Op, char Constraint, SelectionDAG &DAG) {
|
|||||||
case 'I':
|
case 'I':
|
||||||
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
|
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
|
||||||
if (C->getValue() <= 31)
|
if (C->getValue() <= 31)
|
||||||
return Op;
|
return DAG.getTargetConstant(C->getValue(), Op.getValueType());
|
||||||
}
|
}
|
||||||
return SDOperand(0,0);
|
return SDOperand(0,0);
|
||||||
case 'N':
|
case 'N':
|
||||||
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
|
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
|
||||||
if (C->getValue() <= 255)
|
if (C->getValue() <= 255)
|
||||||
return Op;
|
return DAG.getTargetConstant(C->getValue(), Op.getValueType());
|
||||||
}
|
}
|
||||||
return SDOperand(0,0);
|
return SDOperand(0,0);
|
||||||
case 'i': {
|
case 'i': {
|
||||||
// Literal immediates are always ok.
|
// Literal immediates are always ok.
|
||||||
if (isa<ConstantSDNode>(Op)) return Op;
|
if (ConstantSDNode *CST = dyn_cast<ConstantSDNode>(Op))
|
||||||
|
return DAG.getTargetConstant(CST->getValue(), Op.getValueType());
|
||||||
|
|
||||||
// If we are in non-pic codegen mode, we allow the address of a global (with
|
// If we are in non-pic codegen mode, we allow the address of a global (with
|
||||||
// an optional displacement) to be used with 'i'.
|
// an optional displacement) to be used with 'i'.
|
||||||
|
Reference in New Issue
Block a user