[PATCH] aarch64: Implement math acceleration via builtins
Szabolcs Nagy
szabolcs.nagy@arm.com
Mon Oct 16 09:37:00 GMT 2017
On 13/10/17 23:36, Adhemerval Zanella wrote:
> On 13/10/2017 18:26, Michael Collison wrote:
>> +long long int
>> +__llrint (double x)
>> +{
>> + double r = __builtin_rint (x);
>> +
>> + // Prevent gcc from calling lrint directly when compiled with -fno-math-errno
>> + // by inserting a barrier
>> +
>> + math_opt_barrier (r);
>
> I am not seeing any difference on code generation with or without the
> math barrier when using GCC 4.9, GCC7 or GCC mainline with or without
> -fno-math-errno (I am seeing just a combination of frintx plus fcvtzs).
> Do we really need this barrier here?
>
https://godbolt.org/g/zgvReU
if gcc can do this transformation then we
better put a barrier there.
> Also I think the comment line is too long and I am not sure if it is
> usual to use '//' comments (usually we use default '/*' '*/' pairs).
>
>> + return r;
>> +}
More information about the Libc-alpha
mailing list