+#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))
{
}
void
-test_isless(double x, double y, int true)
+test_isless(FLOAT x, FLOAT y, int true)
{
if (__builtin_isless(x, y))
{
}
void
-test_islessequal(double x, double y, int true)
+test_islessequal(FLOAT x, FLOAT y, int true)
{
if (__builtin_islessequal(x, y))
{
}
void
-test_isgreater(double x, double y, int true)
+test_isgreater(FLOAT x, FLOAT y, int true)
{
if (__builtin_isgreater(x, y))
{
}
void
-test_isgreaterequal(double x, double y, int true)
+test_isgreaterequal(FLOAT x, FLOAT y, int true)
{
if (__builtin_isgreaterequal(x, y))
{
}
void
-test_islessgreater(double x, double y, int true)
+test_islessgreater(FLOAT x, FLOAT y, int true)
{
if (__builtin_islessgreater(x, y))
{
{
struct try
{
- double x, y;
+ FLOAT x, y;
unsigned unord : 1;
unsigned lt : 1;
unsigned le : 1;
+#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 ();
{
struct try
{
- double x, y;
+ FLOAT x, y;
int result[6];
};
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[] =