Re: [PATCH] libm/machine/riscv: Add custom fma/sqrt functions when supported

Kito Cheng via Newlib <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <CA+yXCZC5i7zX7eV+AJ4gU29rmU5vraFFNkPyjJ3=LsJsNUqn-g@mail.gmail.com>
Hi Keith:

Thanks for your patch! only a minor comment, otherwise LGTM :)

> --- a/newlib/libm/common/math_config.h
> +++ b/newlib/libm/common/math_config.h
> @@ -72,7 +72,7 @@
>
>  /* Compiler can inline fma as a single instruction.  */
>  #ifndef HAVE_FAST_FMA
> -# if __aarch64__ || (__ARM_FEATURE_FMA && (__ARM_FP & 8))
> +# if __aarch64__ || (__ARM_FEATURE_FMA && (__ARM_FP & 8)) || __riscv_flen == 64

Maybe __riscv_flen >= 64 would be better, __riscv_flen could be 128
when Q extension is present,
although it's not supported on upstream gcc yet :P
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.