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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Segher,

Thanks for your response.

Can you confirm then, that despite returning a 64-bit value, the result will never actually cross the maximal 32-bit value? Can you perhaps point us at gcc code, so that we can try to ensure that?

Thanks,
Alex.


-----Original Message----- From: Segher Boessenkool
Sent: Monday, February 12, 2018 5:01 PM
To: Eitan Azriel
Cc: gcc-help@xxxxxxxxxxx ; Alex Lyakas ; hjl.tools@xxxxxxxxx
Subject: Re: Can _mm_crc32_u64() return a value that is bigger than MAX_UINT32?

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



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux