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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [ieee/] [unsafe-fp-assoc-1.c] - Blame information for rev 825

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

Line No. Rev Author Line
1 149 jeremybenn
extern void abort();
2
 
3
typedef union {
4
       struct {
5
  unsigned int hi;
6
  unsigned int lo;
7
 } i;
8
       double d;
9
} hexdouble;
10
 
11
static const double twoTo52 = 0x1.0p+52;
12
 
13
void func ( double x )
14
{
15
      hexdouble argument;
16
      register double y, z;
17
      unsigned int xHead;
18
      argument.d = x;
19
      xHead = argument.i.hi & 0x7fffffff;
20
      if (__builtin_expect(!!(xHead < 0x43300000u), 1))
21
       {
22
                  y = ( x - twoTo52 ) + twoTo52;
23
                  if ( y != x )
24
                    abort();
25
                  z = x - 0.5;
26
                  y = ( z - twoTo52 ) + twoTo52;
27
                  if ( y == (( x - twoTo52 ) + twoTo52) )
28
                    abort();
29
       }
30
     return;
31
}
32
 
33
int main()
34
{
35
        func((double)1.00);
36
        return 0;
37
}

powered by: WebSVN 2.1.0

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