Skip to content

Commit c9cd8e6

Browse files
authored
PMULL is slow on ARM64, let us not rely on it? (simdjson#391)
1 parent 74a9687 commit c9cd8e6

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ architecture:=$(shell arch)
1717
# E.g., type ' ARCHFLAGS="-march=nehalem" make parse '
1818
###
1919
ifeq ($(architecture),aarch64)
20-
ARCHFLAGS ?= -march=armv8-a+crc+crypto
20+
ARCHFLAGS ?= -march=armv8-a
2121
else
2222
ARCHFLAGS ?= -msse4.2 -mpclmul # lowest supported feature set?
2323
endif

src/arm64/bitmask.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ namespace simdjson::arm64 {
1616
// For example, prefix_xor(00100100) == 00011100
1717
//
1818
really_inline uint64_t prefix_xor(uint64_t bitmask) {
19-
20-
#ifdef __ARM_FEATURE_CRYPTO // some ARM processors lack this extension
21-
return vmull_p64(-1ULL, bitmask);
22-
#else
19+
//
20+
// We could do this with PMULL, but it is apparently slow.
21+
//
22+
//#ifdef __ARM_FEATURE_CRYPTO // some ARM processors lack this extension
23+
//return vmull_p64(-1ULL, bitmask);
24+
//#else
2325
bitmask ^= bitmask << 1;
2426
bitmask ^= bitmask << 2;
2527
bitmask ^= bitmask << 4;
2628
bitmask ^= bitmask << 8;
2729
bitmask ^= bitmask << 16;
2830
bitmask ^= bitmask << 32;
2931
return bitmask;
30-
#endif
31-
3232
}
3333

3434
} // namespace simdjson::arm64

0 commit comments

Comments
 (0)