diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index cb0b30c857e..de379e5e5f3 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -8468,7 +8468,7 @@ void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op, return; case 'J': if (ConstantSDNode *C = dyn_cast(Op)) { - if ((int8_t)C->getSExtValue() == C->getSExtValue()) { + if (C->getZExtValue() <= 63) { Result = DAG.getTargetConstant(C->getZExtValue(), Op.getValueType()); break; } @@ -8476,7 +8476,7 @@ void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op, return; case 'K': if (ConstantSDNode *C = dyn_cast(Op)) { - if (C->getZExtValue() <= 63) { + if ((int8_t)C->getSExtValue() == C->getSExtValue()) { Result = DAG.getTargetConstant(C->getZExtValue(), Op.getValueType()); break; }