[PATCH] riscv: Set __GLIBC_FLT_EVAL_METHOD to 0 if __FLT_EVAL_METHOD__ is -1

Kito Cheng kito.cheng@sifive.com
Thu Feb 16 13:48:50 GMT 2023


For anyone who interested on this issue, but not tracking LLVM community:
LLVM has created a bug to track this:
https://github.com/llvm/llvm-project/issues/60781

Hi Wilco:

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.

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.

[1] https://github.com/bminor/glibc/blob/master/bits/flt-eval-method.h#L23

On Wed, Feb 15, 2023 at 10:13 PM Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
>
> Hi Kito,
>
> This looks like a recent bug in LLVM - even with -Ofast compilers continue to
> use float and double for evaluation (obviously!), so float_t and double_t should
> not change (which may break ABI if some code uses -Ofast and some doesn't,
> leading to incompatible float_t/double_t definitions).
>
> So this should be reported to and fixed in LLVM, and if we want/need to work
> around it in GLIBC, it should be done in the generic flt-eval-method.h header
> so that it works on all targets.
>
> Cheers,
> Wilco


More information about the Libc-alpha mailing list