OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [ieee/] [pr50310.c] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
/* PR target/50310 */
2
 
3
extern void abort (void);
4
double s1[4], s2[4], s3[64];
5
 
6
void
7
foo (void)
8
{
9
  int i;
10
  for (i = 0; i < 4; i++)
11
    s3[0 * 4 + i] = __builtin_isgreater (s1[i], s2[i]) ? -1.0 : 0.0;
12
  for (i = 0; i < 4; i++)
13
    s3[1 * 4 + i] = (!__builtin_isgreater (s1[i], s2[i])) ? -1.0 : 0.0;
14
  for (i = 0; i < 4; i++)
15
    s3[2 * 4 + i] = __builtin_isgreaterequal (s1[i], s2[i]) ? -1.0 : 0.0;
16
  for (i = 0; i < 4; i++)
17
    s3[3 * 4 + i] = (!__builtin_isgreaterequal (s1[i], s2[i])) ? -1.0 : 0.0;
18
  for (i = 0; i < 4; i++)
19
    s3[4 * 4 + i] = __builtin_isless (s1[i], s2[i]) ? -1.0 : 0.0;
20
  for (i = 0; i < 4; i++)
21
    s3[5 * 4 + i] = (!__builtin_isless (s1[i], s2[i])) ? -1.0 : 0.0;
22
  for (i = 0; i < 4; i++)
23
    s3[6 * 4 + i] = __builtin_islessequal (s1[i], s2[i]) ? -1.0 : 0.0;
24
  for (i = 0; i < 4; i++)
25
    s3[7 * 4 + i] = (!__builtin_islessequal (s1[i], s2[i])) ? -1.0 : 0.0;
26
  for (i = 0; i < 4; i++)
27
    s3[8 * 4 + i] = __builtin_islessgreater (s1[i], s2[i]) ? -1.0 : 0.0;
28
  for (i = 0; i < 4; i++)
29
    s3[9 * 4 + i] = (!__builtin_islessgreater (s1[i], s2[i])) ? -1.0 : 0.0;
30
  for (i = 0; i < 4; i++)
31
    s3[10 * 4 + i] = __builtin_isunordered (s1[i], s2[i]) ? -1.0 : 0.0;
32
  for (i = 0; i < 4; i++)
33
    s3[11 * 4 + i] = (!__builtin_isunordered (s1[i], s2[i])) ? -1.0 : 0.0;
34
  for (i = 0; i < 4; i++)
35
    s3[12 * 4 + i] = s1[i] > s2[i] ? -1.0 : 0.0;
36
  for (i = 0; i < 4; i++)
37
    s3[13 * 4 + i] = s1[i] <= s2[i] ? -1.0 : 0.0;
38
  for (i = 0; i < 4; i++)
39
    s3[14 * 4 + i] = s1[i] < s2[i] ? -1.0 : 0.0;
40
  for (i = 0; i < 4; i++)
41
    s3[15 * 4 + i] = s1[i] >= s2[i] ? -1.0 : 0.0;
42
}
43
 
44
int
45
main ()
46
{
47
  int i;
48
  s1[0] = 5.0;
49
  s1[1] = 6.0;
50
  s1[2] = 5.0;
51
  s1[3] = __builtin_nan ("");
52
  s2[0] = 6.0;
53
  s2[1] = 5.0;
54
  s2[2] = 5.0;
55
  s2[3] = 5.0;
56
  asm volatile ("" : : : "memory");
57
  foo ();
58
  asm volatile ("" : : : "memory");
59
  for (i = 0; i < 16 * 4; i++)
60
    if (i >= 12 * 4 && (i & 3) == 3)
61
      {
62
        if (s3[i] != 0.0) abort ();
63
      }
64
    else
65
      {
66
        static int masks[] = { 2, 2|4, 1, 1|4, 1|2, 8, 2, 1 };
67
        if (s3[i]
68
            != (((1 << (i & 3)) & ((i & 4) ? ~masks[i / 8] : masks[i / 8]))
69
                ? -1.0 : 0.0))
70
          abort ();
71
      }
72
  return 0;
73
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.