[PATCH] D85031: [builtins] Unify the softfloat division implementation

Anatoly Trosinenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 31 09:02:51 PDT 2020


atrosinenko added a comment.

Here are the benchmark and fuzzing harness used to test this patch.

F12453076: fuzz_divXf3.sh <https://reviews.llvm.org/F12453076>

F12453075: divXf3_fuzzer.c <https://reviews.llvm.org/F12453075>

F12453074: bench_divXf3.sh <https://reviews.llvm.org/F12453074>

F12453073: divXf3_bench.c <https://reviews.llvm.org/F12453073>



================
Comment at: compiler-rt/lib/builtins/fp_div_impl.inc:248-249
+  if (quotient_UQ1 < (implicitBit << 1)) {
+    residualLo = (aSignificand << (significandBits + 1)) - quotient_UQ1 * bSignificand;
+    writtenExponent -= 1;
+
----------------
Interesting fact: swapping these two seemingly commuting lines makes code slower by 15-25%. This applies to current Clang as well as to `clang-8` from Ubuntu 20.04 repository.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85031



More information about the cfe-commits mailing list