TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Intel SSE 4.2 CRC32C instruction set question – why return uint64_t?

1 点作者 amrith大约 3 年前
The Intel SSE 4.2 instruction set added the new CRC32C computation instructions. They are super cool and they are SO MUCH faster than doing the CRC calculation in software.<p>But, as I was coding up crc32c for something, I noticed that the CRC32 instruction has a mode that returns a 64 bit value for 64 bit source operands, and a 64 bit value for an 8 bit source operand (in addition to 32 bit values for all the others).<p>https:&#x2F;&#x2F;www.intel.com&#x2F;content&#x2F;dam&#x2F;www&#x2F;public&#x2F;us&#x2F;en&#x2F;documents&#x2F;manuals&#x2F;64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf<p>See page 2A 3-225 and 226.<p>This means there is a strange<p>unsigned __int64 _mm_crc32_u64() in the Intel intrinsics (see https:&#x2F;&#x2F;www.intel.com&#x2F;content&#x2F;www&#x2F;us&#x2F;en&#x2F;docs&#x2F;intrinsics-guide&#x2F;index.html#ig_expand=1494,1494&amp;techs=SSE4_2).<p>It isn&#x27;t a big deal, return a 64 bit value with the top two bytes set to zero, the result is correct. But, I&#x27;m sure there was some reason why Intel did this, has anyone found a good explanation for this somewhere - I&#x27;m asking only out of curiosity, not asserting that it is wrong or something.<p>I would have thought unsigned __int32 _mm_crc32_u64() would be more reasonable at least for the intrinsic, no?

暂无评论

暂无评论