Re: Re: Uh, this is *not* a 64-bit CRC ... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: Uh, this is *not* a 64-bit CRC ...
Date
Msg-id 9432.983979247@sss.pgh.pa.us
Whole thread Raw
In response to Re: Uh, this is *not* a 64-bit CRC ...  ("Vadim Mikheev" <vmikheev@sectorbase.com>)
List pgsql-hackers
"Vadim Mikheev" <vmikheev@sectorbase.com> writes:
> I've asked if anyone can send crc64 impl to me and got only one from
> Nathan Myers. Unfortunately, SWISS-PROT impl assumes that long long
> is 8 bytes - is it portable?

No, it's not.  I have written an implementation that uses uint64 if
available (per configure results) otherwise a pair of uint32 registers.
(See pg_crc.h in as-yet-uncommitted patches I posted to pgpatches.)

Interestingly, gcc -O on HP-PA generates essentially the same code
sequence for either the 64- or dual-32-bit versions of the macro...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Martin Devera
Date:
Subject: Re: WAL & SHM principles
Next
From: Tom Lane
Date:
Subject: Re: AW: AW: AW: AW: AW: WAL-based allocation of XIDs is ins ecur e