[llvm] [SDAG] Honor signed arguments in floating point libcalls (PR #109134)

Timothy Pearson via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 14:41:34 PDT 2024


================
@@ -2205,7 +2205,24 @@ void SelectionDAGLegalize::ExpandFPLibCall(SDNode* Node,
     Results.push_back(Tmp.first);
     Results.push_back(Tmp.second);
   } else {
-    SDValue Tmp = ExpandLibCall(LC, Node, false).first;
+    bool IsSignedArgument = false;
+    switch (LC) {
+    case RTLIB::LDEXP_F32:
+    case RTLIB::LDEXP_F64:
+    case RTLIB::LDEXP_F80:
+    case RTLIB::LDEXP_F128:
+    case RTLIB::LDEXP_PPCF128:
+      IsSignedArgument = true;
+      break;
+    case RTLIB::FREXP_F32:
+    case RTLIB::FREXP_F64:
+    case RTLIB::FREXP_F80:
+    case RTLIB::FREXP_F128:
+    case RTLIB::FREXP_PPCF128:
+      IsSignedArgument = true;
+      break;
----------------
tpearson-ssc wrote:

Fair enough.  In the interest of getting this merged, I removed the `frexp` changes -- `ldexp` is the main problem here and what is causing the Chromium problems.

https://github.com/llvm/llvm-project/pull/109134


More information about the llvm-commits mailing list