[PATCH 10/13] s390: Use sqrt{f} builtin
Adhemerval Zanella
adhemerval.zanella@linaro.org
Wed Jun 10 15:59:23 GMT 2020
On 10/06/2020 12:45, Szabolcs Nagy wrote:
> The 06/10/2020 17:39, Stefan Liebler via Libc-alpha wrote:
>> Hi Adhemerval,
>>
>> my last tests with the sqrt builtin on s390x showed that gcc emits a
>> call to libm which would lead to an infinite loop:
>> if (x < 0)
>> sqrt(x)
>> else
>> sqdbr-instruction
>
> in general the builtins based implementation
> must be compiled with -fno-math-errno if
> they have error conditions otherwise math-errno
> may cause the compiler not to do a single
> instruction inline like in this sqrt case.
Afaik libm is already build with -fno-math-errno with:
Makeconfig:849:+extra-math-flags = $(if $(filter libm,$(in-module)),-fno-math-errno,-fmath-errno)
And for some implementation (either default or compat ones)
we have specific wrapper (for instance w_sqrt_*) to handle
errno.
More information about the Libc-alpha
mailing list