|
From: | David Hildenbrand |
Subject: | Re: [PATCH v2 01/26] s390x/tcg: Fix FP CONVERT TO (LOGICAL) FIXED NaN handling |
Date: | Mon, 7 Jun 2021 10:04:00 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 |
On 02.06.21 11:50, David Hildenbrand wrote:
On 01.06.21 23:27, Richard Henderson wrote:On 5/17/21 7:27 AM, David Hildenbrand wrote:@@ -634,6 +664,9 @@ uint64_t HELPER(clfxb)(CPUS390XState *env, uint64_t h, uint64_t l, uint32_t m34)s390_restore_bfp_rounding_mode(env, old_mode);handle_exceptions(env, xxc_from_m34(m34), GETPC()); + if (float128_is_any_nan(make_float128(h, l))) { + return 0; + }I wonder if handle_exceptions should return s390_exc. Then you can test exc = handle_exceptions(...); if (unlikely(exc & S390_IEEE_MASK_INVALID)) { ret = 0; } return ret;I'll give it a thought if that makes things easier.
Looking at partsN(float_to_uint), we also raise float_flag_invalid in other cases, for example with float_class_inf. So IIUC, your proposal would also set "ret = 0" in case our input is +inf, which would be wrong.
-- Thanks, David / dhildenb
[Prev in Thread] | Current Thread | [Next in Thread] |