File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,12 +16,19 @@ namespace simdjson::arm64 {
1616// For example, prefix_xor(00100100) == 00011100
1717//
1818really_inline uint64_t prefix_xor (uint64_t bitmask) {
19- //
19+ // ///////////
2020 // We could do this with PMULL, but it is apparently slow.
2121 //
2222 // #ifdef __ARM_FEATURE_CRYPTO // some ARM processors lack this extension
2323 // return vmull_p64(-1ULL, bitmask);
2424 // #else
25+ // Analysis by @sebpop:
26+ // When diffing the assembly for src/stage1_find_marks.cpp I see that the eors are all spread out
27+ // in between other vector code, so effectively the extra cycles of the sequence do not matter
28+ // because the GPR units are idle otherwise and the critical path is on the FP side.
29+ // Also the PMULL requires two extra fmovs: GPR->FP (3 cycles in N1, 5 cycles in A72 )
30+ // and FP->GPR (2 cycles on N1 and 5 cycles on A72.)
31+ // /////////
2532 bitmask ^= bitmask << 1 ;
2633 bitmask ^= bitmask << 2 ;
2734 bitmask ^= bitmask << 4 ;
You can’t perform that action at this time.
0 commit comments