Re: What exactly is our CRC algorithm?

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Abhijit Menon-Sen <ams(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Andres Freund <andres(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: What exactly is our CRC algorithm?
Date: 2015-03-25 17:18:51
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 02/12/2015 09:26 PM, Heikki Linnakangas wrote:
> On 02/11/2015 04:20 PM, Abhijit Menon-Sen wrote:
>> At 2015-02-11 13:20:29 +0200, hlinnakangas(at)vmware(dot)com wrote:
>>> I don't follow. I didn't change configure at all, compared to your
>>> patch.
>> OK, I extrapolated a little too much. Your patch didn't actually include
>> crc_instructions.h;
> Oh, I'm sorry. Here's the complete patch with crc_instructions.h

I was just about to commit the attached, which is the same as the
previous patch with just cosmetic comment changes, but then I realized
that this probably doesn't compile with Visual Studio 2005 or older. The
code does "#ifdef _MSC_VER", and then uses the _mm_crc32_u64 intrinsic,
but that intrinsic was added in Visual Studio 2008. I think we'll need a
version check there. Or better yet, a direct configure test to check if
the intrinsic exists - that way we get to also use it on Intel
compilers, which I believe also has the same intrinsics.

You want to write that or should I? How do you like this latest version
of the patch otherwise? You had some criticism earlier, but I had
forgotten to include the crc_instructions.h header file in that earlier

- Heikki

Attachment Content-Type Size
v2-0001-Use-Intel-SSE4.2-CRC-instructions-where-available.patch application/x-patch 13.4 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-03-25 17:20:22 Re: What exactly is our CRC algorithm?
Previous Message Peter Geoghegan 2015-03-25 16:42:29 Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0