]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[vxworks] [testsuite] [aarch64] use builtin in pred-not-gen-4.c
authorAlexandre Oliva <oliva@adacore.com>
Thu, 11 May 2023 13:06:25 +0000 (10:06 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 11 May 2023 13:06:25 +0000 (10:06 -0300)
On vxworks, isunordered is defined as a macro that ultimately calls a
_Fpcomp function, that GCC doesn't recognize as a builtin, so it
can't optimize accordingly.

Use __builtin_isunordered instead to get the desired code for the
test.

for  gcc/testsuite/ChangeLog

* gcc.target/aarch64/sve/pred-not-gen-4.c: Drop math.h
include, call builtin.

gcc/testsuite/gcc.target/aarch64/sve/pred-not-gen-4.c

index 0001dd3fc211f5fdd6b92294b3ef651d69410159..1845bd3f0f70446a622c3ac8a9f87e98670e73e4 100644 (file)
@@ -1,12 +1,10 @@
 /* { dg-do compile } */
 /* { dg-options "-O3" } */
 
-#include <math.h>
-
 void f13(double * restrict z, double * restrict w, double * restrict x, double * restrict y, int n)
 {
     for (int i = 0; i < n; i++) {
-        z[i] = (isunordered(w[i], 0)) ? x[i] + w[i] : y[i] - w[i];
+        z[i] = (__builtin_isunordered(w[i], 0)) ? x[i] + w[i] : y[i] - w[i];
     }
 }