[PATCH] D52697: Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by using unsigned division by 2 when possible.

Denis Yaroshevskiy via Phabricator reviews at reviews.llvm.org
Wed Oct 31 15:57:40 PDT 2018


dyaroshev added a comment.

Hi again.

Do you remeber if the difference was this big (5 times): http://quick-bench.com/kguTLHndCQWFuzlxJQT4tJQa_p8 ?
This seems insane

I don't believe that quickbench already has the latest version of the library, because this is the assembly generated
3.69%  mov    %rdx,%rsi
0.12%  mov    %rcx,%rdx

  shr    $0x3f,%rdx

2.89%  add    %rcx,%rdx
5.42%  sar    %rdx
5.06%  add    $0xffffffffffffffff,%rcx

The last 0xffff ... was exactly what this patch removed.
Can someone please take a look? It doesn't feel right.


https://reviews.llvm.org/D52697





More information about the libcxx-commits mailing list