This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] aarch64: Implement math acceleration via builtins
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org
- Cc: nd at arm dot com
- Date: Mon, 16 Oct 2017 10:36:49 +0100
- Subject: Re: [PATCH] aarch64: Implement math acceleration via builtins
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs dot Nagy at arm dot com;
- Nodisclaimer: True
- References: <HE1PR0802MB2377FB89896B3EEAD493799595480@HE1PR0802MB2377.eurprd08.prod.outlook.com> <9e8aaf0f-4346-628e-aa4f-8fad8323e8a3@linaro.org>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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;
>> +}