On 1/31/25 05:09, Peter Maydell wrote:
+/*
+ * AH=1 min/max have some odd special cases:
+ * comparing two zeroes (even of different sign), (NaN, anything),
+ * or (anything, NaN) should return the second argument (possibly
+ * squashed to zero).
+ * Also, denormal outputs are not squashed to zero regardless of FZ or FZ16.
+ */
+#define AH_MINMAX_HELPER(NAME, CTYPE, FLOATTYPE, MINMAX) \
+ CTYPE HELPER(NAME)(CTYPE a, CTYPE b, float_status *fpst) \
+ { \
+ bool save; \
+ CTYPE r; \
+ a = FLOATTYPE ## _squash_input_denormal(a, fpst); \
+ b = FLOATTYPE ## _squash_input_denormal(b, fpst); \
+ if (FLOATTYPE ## _is_zero(a) && FLOATTYPE ## _is_zero(b)) { \
The comment says "even of different sign", the pseudocode explicitly checks
different
sign. But of course if they're the same sign a and b are indistinguishable.
Perhaps
slightly different wording?
Sure. I changed from "(even of different sign)" to
"(regardless of sign)". Let me know if you have a
more specific tweak you'd like.
Sounds good.
r~