I got a program that I know will run only on very specific hardware, so I started using crc32 as supplied by the SSE4.2 instruction set, but now I need crc16 for a different purpose. Is there a way to coax the hardware to give me crc16 with the same performance as SSE's crc32?

Thanks

有帮助吗?

解决方案

If you have the PCLMULQDQ instruction, you can use that to make a fast CRC. Though not quite as fast as the crc32 instruction.

Alternatively, a poor man's check value could be the low 16 bits of the result of crc32.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top