Thread: Re: [COMMITTERS] pgsql: Use Intel SSE 4.2 CRC instructions where available.

Re: [COMMITTERS] pgsql: Use Intel SSE 4.2 CRC instructions where available.

From
Heikki Linnakangas
Date:
On 04/14/2015 06:28 PM, Simon Riggs wrote:
> On 14 April 2015 at 10:09, Heikki Linnakangas <heikki.linnakangas@iki.fi> wrote:
>
>> Abhijit Menon-Sen, heavily modified by me, reviewed by Andres Freund.
>
> Did the heavy modifications have any affect on the patch behaviour, or
> was this just related to where you would like to put the code?

Didn't affect behaviour.

Hmm, the buildfarm animals using Intel C compiler didn't like this 
patch. The problem seems to be that unlike on gcc and clang, icc always 
has the SSE 4.2 intrinsics (_mm_crc32_u64, _mm_crc32_u8 etc.), even when 
the target CPU architecture is not SSE 4.2. On gcc/clang, those 
intrinsics are not defined unless you build with -msse4.2.

I'll try to find a fix. I think we could use the __SSE4_2__ define to 
check whether SSE4.2 is targeted. Or we can punt and always build the 
version with the runtime check, unless overridden manually at configure 
command line.

- Heikki




Re: [COMMITTERS] pgsql: Use Intel SSE 4.2 CRC instructions where available.

From
Simon Riggs
Date:
On 14 April 2015 at 11:34, Heikki Linnakangas <hlinnaka@iki.fi> wrote:

> Or we can punt and always build the version with
> the runtime check, unless overridden manually at configure command line.

That seems safer as the default, which is what the original patch did.

We can optimise that for known good builds later if desired.

-- Simon Riggs                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, RemoteDBA, Training &
Services



Re: [COMMITTERS] pgsql: Use Intel SSE 4.2 CRC instructions where available.

From
Heikki Linnakangas
Date:
On 04/14/2015 07:01 PM, Simon Riggs wrote:
> On 14 April 2015 at 11:34, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
>
>> Or we can punt and always build the version with
>> the runtime check, unless overridden manually at configure command line.
>
> That seems safer as the default, which is what the original patch did.
>
> We can optimise that for known good builds later if desired.

I committed the __SSE_4_2__ test for now, so we still build the SSE-only 
version if the target allows that. We'll see how that works..

- Heikki