On 9/5/22 17:31, Víctor Colombo wrote:
I have a message bookmarked here ([1]), but I don't know if there is a
previous one with a more in depth scheme.
There may have been a previous, but that's the one I was thinking of.
Anyway, I was also analyzing recently the idea of removing all these
reset_fpstatus() calls from instructions helpers. I think this would
require to actually call it from the end of the (previous) instructions instead of the
beginning? Like adding the call to
do_float_check_status() and float_invalid_op_*() as a focal point to
'hide' the calls to reset_fpstatus().
Well, there would of course be no separate call, but do_float_check_status
would:
int status = get_float_exception_flags(&env->fp_status);
set_float_exception_flags(0, &env->fp_status);
straight away. No extra call overhead, and the steady-state of softfp exception flags
outside of an in-progress fp operation is 0.
However there are also insns
helpers that don't call these auxiliary functions, which I think would
cause the refactor to not be worthy overall.
Anything that can raise a softfp exception and doesn't do something with it, either
immediately within the same helper, or just afterward with helper_float_check_status, is
buggy. With those fixed, helper_reset_fpstatus may be removed entirely.
r~