Fix a bug where we were not emitting a cvt rnd sat node for converting

between a unsigned integer and signed integer.

llvm-svn: 63831
This commit is contained in:
Mon P Wang 2009-02-05 04:47:42 +00:00
parent 8691c47e9e
commit 3f0e0a6dea
1 changed files with 4 additions and 2 deletions

View File

@ -1170,8 +1170,10 @@ SDValue SelectionDAG::getConvertRndSat(MVT VT, DebugLoc dl,
SDValue Val, SDValue DTy,
SDValue STy, SDValue Rnd, SDValue Sat,
ISD::CvtCode Code) {
// If the src and dest types are the same, no conversion is necessary.
if (DTy == STy)
// If the src and dest types are the same and the conversion is between
// integer types of the same sign or two floats, no conversion is necessary.
if (DTy == STy &&
(Code == ISD::CVT_UU || Code == ISD::CVT_SS || Code == ISD::CVT_FF))
return Val;
FoldingSetNodeID ID;