mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-20 02:28:23 +00:00
Use ZERO_EXTEND instead of ANY_EXTEND when promoting
shift amounts, to avoid implicitly assuming that target architectures will ignore the high bits. llvm-svn: 63169
This commit is contained in:
parent
2cea322e5f
commit
0efa2bd617
@ -974,7 +974,7 @@ SDValue SelectionDAGLegalize::LegalizeShiftAmount(SDValue ShiftAmt) {
|
||||
return DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), ShiftAmt);
|
||||
|
||||
if (TLI.getShiftAmountTy().bitsGT(ShiftAmt.getValueType()))
|
||||
return DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), ShiftAmt);
|
||||
return DAG.getNode(ISD::ZERO_EXTEND, TLI.getShiftAmountTy(), ShiftAmt);
|
||||
|
||||
return ShiftAmt;
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ SDValue DAGTypeLegalizer::ScalarizeVecRes_ShiftOp(SDNode *N) {
|
||||
if (TLI.getShiftAmountTy().bitsLT(ShiftAmt.getValueType()))
|
||||
ShiftAmt = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), ShiftAmt);
|
||||
else if (TLI.getShiftAmountTy().bitsGT(ShiftAmt.getValueType()))
|
||||
ShiftAmt = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), ShiftAmt);
|
||||
ShiftAmt = DAG.getNode(ISD::ZERO_EXTEND, TLI.getShiftAmountTy(), ShiftAmt);
|
||||
|
||||
return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, ShiftAmt);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user