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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [pr24627.c] - Blame information for rev 867

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O" } */
3
/* { dg-require-effective-target int32plus } */
4
 
5
extern void abort (void);
6
typedef unsigned int u_int32;
7
 
8
typedef struct {
9
  union {u_int32 Xl_ui;} Ul_i;
10
  union {u_int32 Xl_uf;} Ul_f;
11
} l_fp;
12
 
13
void
14
dolfptoa (short ndec)
15
{
16
  l_fp work, ftmp;
17
 
18
  work.Ul_i.Xl_ui = 0;
19
  work.Ul_f.Xl_uf = 0x535f3d8;
20
 
21
  while (ndec > 0)
22
    {
23
      u_int32 lo_tmp;
24
      u_int32 hi_tmp;
25
 
26
      ndec--;
27
      work.Ul_i.Xl_ui = 0;
28
      work.Ul_i.Xl_ui <<= 1;
29
      if ((work.Ul_f.Xl_uf) & 0x80000000)
30
        (work.Ul_i.Xl_ui) |= 0x1;
31
      (work.Ul_f.Xl_uf) <<= 1;
32
 
33
      ftmp = work;
34
      (work.Ul_i.Xl_ui) <<= 1;
35
      if ((work.Ul_f.Xl_uf) & 0x80000000)
36
        (work.Ul_i.Xl_ui) |= 0x1;
37
      (work.Ul_f.Xl_uf) <<= 1;
38
 
39
      (work.Ul_i.Xl_ui) <<= 1;
40
      if ((work.Ul_f.Xl_uf) & 0x80000000)
41
        (work.Ul_i.Xl_ui) |= 0x1;
42
      (work.Ul_f.Xl_uf) <<= 1;
43
 
44
      lo_tmp = ((work.Ul_f.Xl_uf) & 0xffff) + ((ftmp.Ul_f.Xl_uf) & 0xffff);
45
      hi_tmp = (((work.Ul_f.Xl_uf) >> 16) & 0xffff)
46
               + (((ftmp.Ul_f.Xl_uf) >> 16) & 0xffff);
47
 
48
      if (lo_tmp & 0x10000)
49
        hi_tmp++;
50
 
51
      (work.Ul_f.Xl_uf) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff);
52
      (work.Ul_i.Xl_ui) += (ftmp.Ul_i.Xl_ui);
53
 
54
      if (hi_tmp & 0x10000)
55
        (work.Ul_i.Xl_ui)++;
56
 
57
 
58
      if (!(work.Ul_i.Xl_ui < 10))
59
        abort ();
60
    }
61
}
62
 
63
int main()
64
{
65
  dolfptoa(6);
66
  return 0;
67
}

powered by: WebSVN 2.1.0

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