[all-commits] [llvm/llvm-project] 27a062: [libc++] Implement std::gcd using the binary versi...

serge-sans-paille via All-commits all-commits at lists.llvm.org
Wed May 8 07:21:53 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 27a062e9ca7c92e89ed4084c3c3affb9fa39aabb
      https://github.com/llvm/llvm-project/commit/27a062e9ca7c92e89ed4084c3c3affb9fa39aabb
  Author: serge-sans-paille <sguelton at mozilla.com>
  Date:   2024-05-08 (Wed, 08 May 2024)

  Changed paths:
    M libcxx/benchmarks/CMakeLists.txt
    A libcxx/benchmarks/numeric/gcd.bench.cpp
    M libcxx/include/__numeric/gcd_lcm.h
    M libcxx/test/libcxx/transitive_includes/cxx03.csv
    M libcxx/test/libcxx/transitive_includes/cxx11.csv
    M libcxx/test/libcxx/transitive_includes/cxx14.csv
    M libcxx/test/libcxx/transitive_includes/cxx17.csv
    M libcxx/test/libcxx/transitive_includes/cxx20.csv
    M libcxx/test/libcxx/transitive_includes/cxx26.csv
    M libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp

  Log Message:
  -----------
  [libc++] Implement std::gcd using the binary version (#77747)

The binary version is four times faster than current implementation in
my setup, and generally considered a better implementation.

Code inspired by https://en.algorithmica.org/hpc/algorithms/gcd/ which
itself is inspired by
https://lemire.me/blog/2013/12/26/fastest-way-to-compute-the-greatest-common-divisor/

Fix #77648



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list