[libc-commits] [PATCH] D129005: [libc][math] Improved performance of exp2f function.

Paul Zimmermann via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jul 12 03:58:32 PDT 2022


zimmermann6 added a comment.

I confirm the new function is correctly rounded (for all rounding modes). For what concerns efficiency, here is what I get on a AMD EPYC 7282 with gcc 10.2.1 and clang 11.0.1-2:

  zimmerma at biscotte:~/svn/core-math$ LIBM=/localdisk/zimmerma/llvm-project/build/projects/libc/lib/libllvmlibc.a CORE_MATH_PERF_MODE=rdtsc ./perf.sh exp2f
  GNU libc version: 2.31
  GNU libc release: stable
  9.720
  6.228
  18.081
  
  
  zimmerma at biscotte:~/svn/core-math$ LIBM=/localdisk/zimmerma/llvm-project/build/projects/libc/lib/libllvmlibc-bec8dff.a CORE_MATH_PERF_MODE=rdtsc ./perf.sh exp2f
  GNU libc version: 2.31
  GNU libc release: stable
  9.714
  6.215
  23.455

The first run is with this patch, the second one with revision bec8dff <https://reviews.llvm.org/rGbec8dff33e2bf68c72f24e80ee1a734036c4bbe0> of llvm-libc: the reciprocal throughput decreased from 23 to 18 cycles.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129005/new/

https://reviews.llvm.org/D129005



More information about the libc-commits mailing list