[PATCH] D129017: [fpcmp] Use non-floating point parsing by default.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 12:30:11 PDT 2022


Meinersbur added inline comments.


================
Comment at: MultiSource/Benchmarks/TSVC/CMakeLists.txt:1-5
+
+# Expect exact numeric results. However, the libc printf implementation emits
+# 'E' in scientific notation, while the reference output contains 'e'.
+set(FP_ABSTOLERANCE 0.0)
+
----------------
MatzeB wrote:
> I wonder if we shouldn't rather change the reference output. But fine with me if things aren't that easy to fix.
Different printf implementations may implement floating point formatting differently. I only tested under Linux, I don't know what other libc implementations do and I don't think the test should fail on other platforms.

Generally, I am hesitant to change the reference output, which was hand-vetted and may have come from the benchmark itself. For SPEC benchmarks we cannot because the references come with the benchmark. D128261 is another case where the output is different between LLVM and GNU, but both seem to be correct.


================
Comment at: tools/fpcmp.c:385-386
+      "(even if zero), floating numbers are parsed and considered equal if "
+      "neither the absolute nor relative tolerance is exceeded.");
+  fprintf(stderr, "The -i switch also ignores whitespace differences\n");
   exit(2);
----------------
MatzeB wrote:
> Why didn't you also combine the last string with the others?
I think I left the last string unchanged at first and only later added "also". Changed.


Repository:
  rT test-suite

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

https://reviews.llvm.org/D129017



More information about the llvm-commits mailing list