From: H.J. Lu Date: Mon, 7 Jun 2004 02:38:46 +0000 (+0000) Subject: fp-cmp-4.c (FLOAT): New. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aab087b805ed8609dab58426e00c8994b59d5c07;p=gcc.git fp-cmp-4.c (FLOAT): New. 2004-06-06 H.J. Lu * gcc.c-torture/execute/ieee/fp-cmp-4.c (FLOAT): New. Default to double. Replace double with FLOAT. * gcc.c-torture/execute/ieee/fp-cmp-8.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-4e.c: New file. * gcc.c-torture/execute/ieee/fp-cmp-4f.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-4l.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-4q.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-8e.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-8f.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-8l.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-8q.c: Likewise. From-SVN: r82680 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 17871dd339e..8d6561fc5a5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,18 @@ +2004-06-06 H.J. Lu + + * gcc.c-torture/execute/ieee/fp-cmp-4.c (FLOAT): New. Default + to double. Replace double with FLOAT. + * gcc.c-torture/execute/ieee/fp-cmp-8.c: Likewise. + + * gcc.c-torture/execute/ieee/fp-cmp-4e.c: New file. + * gcc.c-torture/execute/ieee/fp-cmp-4f.c: Likewise. + * gcc.c-torture/execute/ieee/fp-cmp-4l.c: Likewise. + * gcc.c-torture/execute/ieee/fp-cmp-4q.c: Likewise. + * gcc.c-torture/execute/ieee/fp-cmp-8e.c: Likewise. + * gcc.c-torture/execute/ieee/fp-cmp-8f.c: Likewise. + * gcc.c-torture/execute/ieee/fp-cmp-8l.c: Likewise. + * gcc.c-torture/execute/ieee/fp-cmp-8q.c: Likewise. + 2004-06-06 Joseph S. Myers PR c/13519 diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.c index 45527a23aff..d4bb9c6c6b5 100644 --- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.c +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.c @@ -1,5 +1,9 @@ +#ifndef FLOAT +#define FLOAT double +#endif + void -test_isunordered(double x, double y, int true) +test_isunordered(FLOAT x, FLOAT y, int true) { if (__builtin_isunordered(x, y)) { @@ -14,7 +18,7 @@ test_isunordered(double x, double y, int true) } void -test_isless(double x, double y, int true) +test_isless(FLOAT x, FLOAT y, int true) { if (__builtin_isless(x, y)) { @@ -29,7 +33,7 @@ test_isless(double x, double y, int true) } void -test_islessequal(double x, double y, int true) +test_islessequal(FLOAT x, FLOAT y, int true) { if (__builtin_islessequal(x, y)) { @@ -44,7 +48,7 @@ test_islessequal(double x, double y, int true) } void -test_isgreater(double x, double y, int true) +test_isgreater(FLOAT x, FLOAT y, int true) { if (__builtin_isgreater(x, y)) { @@ -59,7 +63,7 @@ test_isgreater(double x, double y, int true) } void -test_isgreaterequal(double x, double y, int true) +test_isgreaterequal(FLOAT x, FLOAT y, int true) { if (__builtin_isgreaterequal(x, y)) { @@ -74,7 +78,7 @@ test_isgreaterequal(double x, double y, int true) } void -test_islessgreater(double x, double y, int true) +test_islessgreater(FLOAT x, FLOAT y, int true) { if (__builtin_islessgreater(x, y)) { @@ -95,7 +99,7 @@ main() { struct try { - double x, y; + FLOAT x, y; unsigned unord : 1; unsigned lt : 1; unsigned le : 1; diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4e.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4e.c new file mode 100644 index 00000000000..c8cacb27a55 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4e.c @@ -0,0 +1,10 @@ +#if defined (__ia64__) && defined (__hpux__) +#define FLOAT __float80 +#include "fp-cmp-4.c" +#else +int +main () +{ + return 0; +} +#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.c new file mode 100644 index 00000000000..6221b250dff --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.c @@ -0,0 +1,2 @@ +#define FLOAT float +#include "fp-cmp-4.c" diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.c new file mode 100644 index 00000000000..5ac8b7565b5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.c @@ -0,0 +1,2 @@ +#define FLOAT long double +#include "fp-cmp-4.c" diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4q.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4q.c new file mode 100644 index 00000000000..0d6adf4d1a5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4q.c @@ -0,0 +1,10 @@ +#if defined (__x86_64__) || (defined (__ia64__) && !defined (__hpux__)) +#define FLOAT __float128 +#include "fp-cmp-4.c" +#else +int +main () +{ + return 0; +} +#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8.c index 225539b83eb..7e24c66d98d 100644 --- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8.c +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8.c @@ -1,81 +1,85 @@ +#ifndef FLOAT +#define FLOAT double +#endif + /* Like fp-cmp-4.c, but test that the cmove patterns are correct. */ -static double -test_isunordered(double x, double y, double a, double b) +static FLOAT +test_isunordered(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return __builtin_isunordered(x, y) ? a : b; } -static double -test_not_isunordered(double x, double y, double a, double b) +static FLOAT +test_not_isunordered(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return !__builtin_isunordered(x, y) ? a : b; } -static double -test_isless(double x, double y, double a, double b) +static FLOAT +test_isless(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return __builtin_isless(x, y) ? a : b; } -static double -test_not_isless(double x, double y, double a, double b) +static FLOAT +test_not_isless(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return !__builtin_isless(x, y) ? a : b; } -static double -test_islessequal(double x, double y, double a, double b) +static FLOAT +test_islessequal(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return __builtin_islessequal(x, y) ? a : b; } -static double -test_not_islessequal(double x, double y, double a, double b) +static FLOAT +test_not_islessequal(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return !__builtin_islessequal(x, y) ? a : b; } -static double -test_isgreater(double x, double y, double a, double b) +static FLOAT +test_isgreater(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return __builtin_isgreater(x, y) ? a : b; } -static double -test_not_isgreater(double x, double y, double a, double b) +static FLOAT +test_not_isgreater(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return !__builtin_isgreater(x, y) ? a : b; } -static double -test_isgreaterequal(double x, double y, double a, double b) +static FLOAT +test_isgreaterequal(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return __builtin_isgreaterequal(x, y) ? a : b; } -static double -test_not_isgreaterequal(double x, double y, double a, double b) +static FLOAT +test_not_isgreaterequal(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return !__builtin_isgreaterequal(x, y) ? a : b; } -static double -test_islessgreater(double x, double y, double a, double b) +static FLOAT +test_islessgreater(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return __builtin_islessgreater(x, y) ? a : b; } -static double -test_not_islessgreater(double x, double y, double a, double b) +static FLOAT +test_not_islessgreater(FLOAT x, FLOAT y, FLOAT a, FLOAT b) { return !__builtin_islessgreater(x, y) ? a : b; } static void -one_test(double x, double y, int expected, - double (*pos) (double, double, double, double), - double (*neg) (double, double, double, double)) +one_test(FLOAT x, FLOAT y, int expected, + FLOAT (*pos) (FLOAT, FLOAT, FLOAT, FLOAT), + FLOAT (*neg) (FLOAT, FLOAT, FLOAT, FLOAT)) { if (((*pos)(x, y, 1.0, 2.0) == 1.0) != expected) abort (); @@ -91,7 +95,7 @@ main() { struct try { - double x, y; + FLOAT x, y; int result[6]; }; @@ -115,8 +119,8 @@ main() struct test { - double (*pos)(double, double, double, double); - double (*neg)(double, double, double, double); + FLOAT (*pos)(FLOAT, FLOAT, FLOAT, FLOAT); + FLOAT (*neg)(FLOAT, FLOAT, FLOAT, FLOAT); }; static struct test const tests[] = diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8e.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8e.c new file mode 100644 index 00000000000..acb83f67fda --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8e.c @@ -0,0 +1,10 @@ +#if defined (__ia64__) && defined (__hpux__) +#define FLOAT __float80 +#include "fp-cmp-8.c" +#else +int +main () +{ + return 0; +} +#endif diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8f.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8f.c new file mode 100644 index 00000000000..9826ec916d2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8f.c @@ -0,0 +1,2 @@ +#define FLOAT float +#include "fp-cmp-8.c" diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8l.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8l.c new file mode 100644 index 00000000000..528eeb0ab7b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8l.c @@ -0,0 +1,2 @@ +#define FLOAT long double +#include "fp-cmp-8.c" diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8q.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8q.c new file mode 100644 index 00000000000..b3fd3b69dd5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-8q.c @@ -0,0 +1,10 @@ +#if defined (__x86_64__) || (defined (__ia64__) && !defined (__hpux__)) +#define FLOAT __float128 +#include "fp-cmp-8.c" +#else +int +main () +{ + return 0; +} +#endif