improve support for fgetsign
authorChris Lattner <sabre@nondot.org>
Sat, 22 Dec 2007 21:26:52 +0000 (21:26 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 22 Dec 2007 21:26:52 +0000 (21:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45322 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index cbeda67727adb887ccf44004c3a006bbe60bfecb..ba0a08bd8cf82b06779537c6e98a05a7f86a8b39 100644 (file)
@@ -1323,6 +1323,11 @@ void SelectionDAG::ComputeMaskedBits(SDOperand Op, uint64_t Mask,
     KnownZero |= (~InMask) & Mask;
     return;
   }
+  case ISD::FGETSIGN:
+    // All bits are zero except the low bit.
+    KnownZero = MVT::getIntVTBitMask(Op.getValueType()) ^ 1;
+    return;
+  
   case ISD::ADD: {
     // If either the LHS or the RHS are Zero, the result is zero.
     ComputeMaskedBits(Op.getOperand(1), Mask, KnownZero, KnownOne, Depth+1);
@@ -3703,6 +3708,7 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const {
   case ISD::FDIV:   return "fdiv";
   case ISD::FREM:   return "frem";
   case ISD::FCOPYSIGN: return "fcopysign";
+  case ISD::FGETSIGN:  return "fgetsign";
 
   case ISD::SETCC:       return "setcc";
   case ISD::SELECT:      return "select";