|
From: | Richard Henderson |
Subject: | Re: [PATCH 45/76] target/arm: Implement FPCR.AH semantics for scalar FMIN/FMAX |
Date: | Fri, 31 Jan 2025 05:37:23 -0800 |
User-agent: | Mozilla Thunderbird |
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~
[Prev in Thread] | Current Thread | [Next in Thread] |