Re: Using 128-bit integers for sum, avg and statistics aggregates

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Using 128-bit integers for sum, avg and statistics aggregates
Date: 2015-01-22 23:27:16
Message-ID: 54C18754.4010509@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/11/2015 02:36 AM, Andres Freund wrote:
> a) Afaics only __int128/unsigned __int128 is defined. See
> https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html
>
> b) I'm doubtful that AC_CHECK_TYPES is a sufficiently good test on all
> platforms. IIRC gcc will generate calls to functions to do the actual
> arithmetic, and I don't think they're guranteed to be available on
> platforms. That how it .e.g. behaves for atomic operations. So my
> guess is that you'll need to check that a program that does actual
> arithmetic still links.
>
> c) Personally I don't see the point of testing __uint128_t. That's just
> a pointless test that makes configure run for longer.

The next version will fix all these issues.

> Hm. It might be nicer to move the if (!state) elog() outside the ifdef,
> and add curly parens inside the ifdef.

Since that change only really works for the *_inv functions I decided to
leave them all as-is for consistency.

>> --- a/src/include/pg_config.h.in
>> +++ b/src/include/pg_config.h.in
>> @@ -678,6 +678,12 @@
>> /* Define to 1 if your compiler understands __VA_ARGS__ in macros. */
>> #undef HAVE__VA_ARGS
>>
> z> +/* Define to 1 if the system has the type `__int128_t'. */
>> +#undef HAVE___INT128_T
>> +
>> +/* Define to 1 if the system has the type `__uint128_t'. */
>> +#undef HAVE___UINT128_T
>
> pg_config.h.win32 should be updated as well.

Will be fixed in the next version.

--
Andreas Karlsson

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-01-22 23:28:39 Re: Back-branch update releases scheduled
Previous Message Tom Lane 2015-01-22 23:23:06 Back-branch update releases scheduled