[PATCH] D61684: [compiler-rt] Make builtins test pass when using i386 gcc as host compiler

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 08:40:27 PDT 2019


thakis created this revision.
thakis added a reviewer: rnk.
Herald added a subscriber: dberris.
Herald added a project: LLVM.

Just-built-clang is used to compile the test, but the library is built with gcc, so the usual 80-bit FPU vs 32-bit SSE mismatch makes the floating computations not bitwise identical. See PR32910 for details.

This uses the same technique used in all the other *c3* tests, see in particular mulsc3_test.c.

(It might be cleaner to add compareResultCF to fp_test.h to force the floats into 32-bit in memory, but this is the less invasive fix.)


https://reviews.llvm.org/D61684

Files:
  compiler-rt/test/builtins/Unit/divsc3_test.c


Index: compiler-rt/test/builtins/Unit/divsc3_test.c
===================================================================
--- compiler-rt/test/builtins/Unit/divsc3_test.c
+++ compiler-rt/test/builtins/Unit/divsc3_test.c
@@ -102,7 +102,7 @@
             {
             float _Complex z = (a * c + b * d) / (c * c + d * d)
                              + (b * c - a * d) / (c * c + d * d) * _Complex_I;
-            if (r != z)
+            if (cabsf((r-z)/r) > 1.e-6)
                 return 1;
             }
             break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61684.198671.patch
Type: text/x-patch
Size: 527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190508/2fa8506f/attachment.bin>


More information about the llvm-commits mailing list