diff options
author | Jeffrey Walton <noloader@gmail.com> | 2021-05-26 02:10:36 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2021-05-26 02:10:36 -0400 |
commit | c40b43346b66455462e38d2b338200559eccdc16 (patch) | |
tree | 91b660ec44e7241ac3197dc91950b8fe4093df09 /crc_simd.cpp | |
parent | 175e7f7af09d811c7253b21f6cd43aaf9cde9751 (diff) | |
download | cryptopp-git-c40b43346b66455462e38d2b338200559eccdc16.tar.gz |
Avoid intermediate stores when using _mm_crc32_u32
Diffstat (limited to 'crc_simd.cpp')
-rw-r--r-- | crc_simd.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crc_simd.cpp b/crc_simd.cpp index d96ced61..c1a0725f 100644 --- a/crc_simd.cpp +++ b/crc_simd.cpp @@ -156,10 +156,9 @@ void CRC32C_Update_SSE42(const byte *s, size_t n, word32& c) for(; n >= 16; s+=16, n-=16)
{
- c = _mm_crc32_u32(c, *CONST_WORD32_CAST(s+ 0));
- c = _mm_crc32_u32(c, *CONST_WORD32_CAST(s+ 4));
- c = _mm_crc32_u32(c, *CONST_WORD32_CAST(s+ 8));
- c = _mm_crc32_u32(c, *CONST_WORD32_CAST(s+12));
+ c = _mm_crc32_u32(_mm_crc32_u32(_mm_crc32_u32(_mm_crc32_u32(c,
+ *CONST_WORD32_CAST(s+ 0)), *CONST_WORD32_CAST(s+ 4)),
+ *CONST_WORD32_CAST(s+ 8)), *CONST_WORD32_CAST(s+12));
}
for(; n >= 4; s+=4, n-=4)
|