[PATCH] riscv: Set __GLIBC_FLT_EVAL_METHOD to 0 if __FLT_EVAL_METHOD__ is -1
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Thu Feb 16 16:57:14 GMT 2023
Hi Kito,
> According to the comment in the flt-eval-method.h,
> it says its mapping -1 to 2 is because it's the most conservatively
> safe assumption[1],
> so that's why I consider fixing that for RISC-V port only.
The most conservative option would be to map -1 to 0 since that is what
the undefined case already does, and this is correct on all targets (68k and x86
have overrides that force it to 2 - IIRC s390 used to use 1 but now uses 0).
> I am happy to send patches to update the generic flt-eval-method.h if
> there are other maintainers that think it's reasonable to change the
> default mapping in glibc.
This bug affects almost all targets, so we want a generic fix. Mapping -1 to 0
seems a reasonable default, but we could also decide to decouple the
float_t/double_t ABI from __FLT_EVAL_METHOD__ if it is no longer treated as
a fixed value for the whole application.
Cheers,
Wilco
More information about the Libc-alpha
mailing list