On 5/21/26 08:35, Peter Maydell wrote:
+float64 float64_fscale(float64 n, int64_t m, float_status *s)
+{
+    /*
+     * Given the 'int' parameter of float64_scalbn, we have to saturate
+     * the 'int64_t' parameter of the operation to some value.  Since
+     * float64 has an 11-bit exponent, saturating to 12 bits is sufficient
+     * to ensure that DBL_TRUE_MIN can be made to overflow.
+     */
+    int sat_m = MIN(MAX(m, -0xfff), 0xfff);
+    return float64_scalbn(n, sat_m, s);
+}
+

I just noticed that this seems to be reinventing the
existing scalbn_d() in sve_helper.c. Could we share the code?

Ah, thanks.  I knew this seemed familiar.
I've moved scalbn_d to vec_internal.h.


r~

Reply via email to