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

Kito Cheng kito.cheng@gmail.com
Wed Aug 12 02:37:43 GMT 2020


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


More information about the Newlib mailing list