|
From: | Richard Henderson |
Subject: | Re: [PATCH 09/15] Hexagon (target/hexagon) use softfloat for float-to-int conversions |
Date: | Thu, 25 Mar 2021 10:09:10 -0600 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 |
On 3/24/21 8:50 PM, Taylor Simpson wrote:
@@ -451,16 +456,28 @@ int32_t HELPER(conv_sf2w)(CPUHexagonState *env, float32 RsV) { int32_t RdV; arch_fpop_start(env); - RdV = conv_sf_to_4s(RsV, &env->fp_status); + /* Hexagon returns -1 for NaN */ + if (float32_is_any_nan(RsV)) { + float_raise(float_flag_invalid, &env->fp_status); + RdV = -1; + } else { + RdV = float32_to_int32(RsV, &env->fp_status); + }
So this is interesting.The 8.3.x Document Bundle, which has the V67 programmer's manual, say the output value is IMPLEMENTATION DEFINED (without saying anything more about defining values for any particular implementation), while the older 2010 manual specifies 0x7fffffff as the result (which is what float32_to_int32 provides).
I must say I find the newer manual very lacking on details, including the non-specification of the Behavior pseudocode functions.
I guess the only thing we can do is document this as matching some particular hardware implementation?
r~
[Prev in Thread] | Current Thread | [Next in Thread] |