emkornfield commented on a change in pull request #6954:
URL: https://github.com/apache/arrow/pull/6954#discussion_r415226495
##########
File path: cpp/src/arrow/util/hash_util.h
##########
@@ -27,39 +27,27 @@
#include "arrow/util/logging.h"
#include "arrow/util/macros.h"
-#include "arrow/util/neon_util.h"
-#include "arrow/util/sse_util.h"
+#include "arrow/util/simd.h"
-static inline uint32_t HW_crc32_u8(uint32_t crc, uint8_t v) {
- DCHECK(false) << "Hardware CRC support is not enabled";
- return 0;
-}
-
-static inline uint32_t HW_crc32_u16(uint32_t crc, uint16_t v) {
- DCHECK(false) << "Hardware CRC support is not enabled";
- return 0;
-}
-
-static inline uint32_t HW_crc32_u32(uint32_t crc, uint32_t v) {
- DCHECK(false) << "Hardware CRC support is not enabled";
- return 0;
-}
-
-static inline uint32_t HW_crc32_u64(uint32_t crc, uint64_t v) {
+#ifdef ARROW_HAVE_SSE4_2
+constexpr auto HW_crc32_u8 = _mm_crc32_u8;
Review comment:
style nits: If possible les spell out the type instead of using auto
(its not all clear what the types are without looking up these exact functions.
Since these are functions, it would be nice to use standard function casing
for them. e.g. Crc32U16, even better might be to define something like:
HardwareCrc<uint16>(uint16) ..
HardwareCrc<uint32>(uint16) ..
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]