Can _mm_crc32_u64() return a value that is bigger than MAX_UINT32?

Segher Boessenkool segher@kernel.crashing.org
Mon Feb 12 15:01:00 GMT 2018


Hello,

On Mon, Feb 12, 2018 at 03:24:14PM +0200, Eitan Azriel wrote:
> The signature of _mm_crc32_u64() is:
> unsigned int64 _mm_crc32_u64 (
>    unsigned __int64 crc,
>    unsigned __int64 v
> );
> 
> Why does it return int64, and not uint32? Shouldn't it return a valid CRC32
> value?

GCC uses int64 because that is what the ABI/API says it should do.

Presumably it uses int64 for output because it does use it for input
and there was the desire to use the same type everywhere.


Segher



More information about the Gcc-help mailing list