Properly fix AVX-512 CRC calculation bug
John Naylor <john.naylor@postgresql.org>
Properly fix AVX-512 CRC calculation bug The problem that led to the workaround in f83f14881c7 was not in fact a compiler bug, but a failure to zero the upper bits of the vector register containing the initial scalar CRC value. Fix that and revert the workaround. Diagnosed-by: Nathan Bossart <nathandbossart@gmail.com> Diagnosed-by: Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> Tested-by: Andy Fan <zhihuifan1213@163.com> Tested-by: Soumyadeep Chakraborty <soumyadeep2007@gmail.com> Reviewed-by: Nathan Bossart <nathandbossart@gmail.com> Reviewed-by: Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> Discussion: https://postgr.es/m/PH8PR11MB82866B07AA6758D12F699C00FB70A@PH8PR11MB8286.namprd11.prod.outlook.com
Files
| Path | Change | +/− |
|---|---|---|
| src/port/pg_crc32c_sse42.c | modified | +1 −1 |
| src/port/pg_crc32c_sse42_choose.c | modified | +1 −3 |
Discussion
- Improve CRC32C performance on SSE4.2 82 messages · 2025-02-05 → 2025-07-13