This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] aarch64: Implement math acceleration via builtins


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;
>> +}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]