summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/ppc-fsel-2.c
blob: 9768b165c245a6d9ed2f349b9f81979fee9bfcc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-options "-O -mpowerpc-gfxopt -g0 -ffinite-math-only" } */
/* { dg-final { scan-assembler-not "^L" } } */

/* Every single one of these should be compiled into straight-line
   code using fsel (or, in a few cases, hardwired to 'true' or
   'false'), no branches anywhere.  */

double
test_isunordered(double x, double y, double a, double b)
{
  return __builtin_isunordered(x, y) ? a : b;
}

double
test_not_isunordered(double x, double y, double a, double b)
{
  return !__builtin_isunordered(x, y) ? a : b;
}

double
test_isless(double x, double y, double a, double b)
{
  return __builtin_isless(x, y) ? a : b;
}

double
test_not_isless(double x, double y, double a, double b)
{
  return !__builtin_isless(x, y) ? a : b;
}

double
test_islessequal(double x, double y, double a, double b)
{
  return __builtin_islessequal(x, y) ? a : b;
}

double
test_not_islessequal(double x, double y, double a, double b)
{
  return !__builtin_islessequal(x, y) ? a : b;
}

double
test_isgreater(double x, double y, double a, double b)
{
  return __builtin_isgreater(x, y) ? a : b;
}

double
test_not_isgreater(double x, double y, double a, double b)
{
  return !__builtin_isgreater(x, y) ? a : b;
}

double
test_isgreaterequal(double x, double y, double a, double b)
{
  return __builtin_isgreaterequal(x, y) ? a : b;
}

double
test_not_isgreaterequal(double x, double y, double a, double b)
{
  return !__builtin_isgreaterequal(x, y) ? a : b;
}

double
test_islessgreater(double x, double y, double a, double b)
{
  return __builtin_islessgreater(x, y) ? a : b;
}

double
test_not_islessgreater(double x, double y, double a, double b)
{
  return !__builtin_islessgreater(x, y) ? a : b;
}