On 4/27/23 13:13, Jakub Jelinek wrote:

+    unsigned bulps = targetm.libm_function_max_error (m_cfn, TYPE_MODE (type),
+                                                     true);
+    if (bulps == ~0U)
+      r.set_varying (type);
+    else if (bulps == 0)
+      r.set (type, dconstm1, dconst1);
+    else
+      {
+       REAL_VALUE_TYPE boundmin, boundmax;
+       boundmax = dconst1;
+       while (bulps--)
+         frange_nextafter (TYPE_MODE (type), boundmax, dconstinf);
+       real_arithmetic (&boundmin, NEGATE_EXPR, &boundmax, NULL);
+       r.set (type, boundmin, boundmax);
+      }

This seems like something we'll do over and over for other operations, right? If so, could you abstract it into a separate function?

Thanks.
Aldy

Reply via email to