Re: What exactly is our CRC algorithm?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: hlinnaka <hlinnaka(at)iki(dot)fi>
Cc: Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)2ndquadrant(dot)com>
Subject: Re: What exactly is our CRC algorithm?
Date: 2015-04-02 22:24:32
Message-ID: CA+TgmoZFzPBY99xDSjFgow0aR_=wLmSjFPBVR6JngmdQwiy42A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 2, 2015 at 5:33 PM, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
> It was added in gcc 4.2. That's good enough for me.

I think it's fine to have optional optimizations that require gcc >=
4.2, as long as older platforms don't break outright.

>>> We have a buildfarm animal that still uses gcc 2.95.3, which was
>>> released in 2001. I don't have a compiler of that vintage to test
>>> with, but I assume an old enough assembler would not know about the
>>> crc32q instruction and fail to compile.
>>
>>
>> GCC from <2002 wouldn't support the symbolic operand names in inline
>> assembly. binutils from <2007 (IIRC) wouldn't support the assembler
>> instructions themselves.
>>
>> We could work around the latter by using the appropriate sequence of
>> bytes. We could work around the former by using the old syntax for
>> operands.
>
> I'm OK with not supporting the new instructions when building with an old
> compiler/assembler. But the build shouldn't fail with an old
> compiler/assembler. Using old syntax or raw bytes just to avoid failing on
> an ancient compiler seems ugly.

I dunno about old syntax, but raw bytes seems like a bad idea, for sure.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-04-02 23:02:59 Re: Re: Abbreviated keys for Datum tuplesort
Previous Message Robert Haas 2015-04-02 22:21:06 Re: Re: Abbreviated keys for Datum tuplesort