================
@@ -242,3 +242,27 @@ KnownFPClass KnownFPClass::log(const KnownFPClass 
&KnownSrc,
 
   return Known;
 }
+
+KnownFPClass KnownFPClass::sqrt(const KnownFPClass &KnownSrc,
+                                DenormalMode Mode) {
+  KnownFPClass Known;
+
+  if (KnownSrc.isKnownNeverPosInfinity())
+    Known.knownNot(fcPosInf);
+  if (KnownSrc.isKnownNever(fcSNan))
+    Known.knownNot(fcSNan);
+
+  // Any negative value besides -0 returns a nan.
+  if (KnownSrc.isKnownNeverNaN() && KnownSrc.cannotBeOrderedLessThanZero())
+    Known.knownNot(fcNan);
+
+  // The only negative value that can be returned is -0 for -0 inputs.
+  Known.knownNot(fcNegInf | fcNegSubnormal | fcNegNormal);
----------------
arsenm wrote:

Changing this is beyond the scope of this PR, this is just moving the code 

https://github.com/llvm/llvm-project/pull/173883
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to