On Wed, Jul 8, 2020 at 9:25 AM Richard Henderson
<richard.hender...@linaro.org> wrote:
>
> On 7/6/20 4:47 PM, Max Filippov wrote:
> > +float64 HELPER(add_d)(CPUXtensaState *env, float64 a, float64 b)
> > +{
> > +    set_use_first_nan(true, &env->fp_status);
> > +    return float64_add(a, b, &env->fp_status);
> > +}
> > +
> >  float32 HELPER(add_s)(CPUXtensaState *env, float32 a, float32 b)
> >  {
> > +    set_use_first_nan(env->config->use_first_nan, &env->fp_status);
> >      return float32_add(a, b, &env->fp_status);
> >  }
>
> I think you can do better than to set the use_first_nan flag before every
> operation.

And it was better, until I found that the rules for float64 are a
bit... peculiar.

> E.g. the translator could remember the previous setting within the TB, only
> changing when necessary.  E.g. if env->config->use_first_nan, then set it
> during reset and never change it again.  Similarly if DFP is not enabled.

This thought crossed my mind too, but then set_use_first_nan only
sets one variable in the float_status and gets inlined.
Is it worth the trouble?

-- 
Thanks.
-- Max

Reply via email to