OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [20020604-1.c] - Blame information for rev 437

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

Line No. Rev Author Line
1 297 jeremybenn
/* { dg-do assemble } */
2
/* { dg-xfail-if "The array is too big" { "m6811-*-* m6812-*-*" } { "*" } { "" } } */
3
/* { dg-skip-if "The array is too big" { "avr-*-*" } { "*" } { "" } } */
4
/* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" "-mn" } { "" } } */
5
/* { dg-skip-if "" { m32c-*-* } { } { } } */
6
 
7
/* PR c/6957
8
   This testcase ICEd at -O2 on IA-32, because
9
   (insn 141 139 142 (set (subreg:SF (reg:QI 72) 0)
10
           (plus:SF (reg:SF 73)
11
               (reg:SF 76))) 525 {*fop_sf_comm_nosse} (insn_list 134 (nil))
12
       (expr_list:REG_DEAD (reg:SF 73) (nil)))
13
   couldn't be reloaded. */
14
 
15
void
16
foo (unsigned int n, int x, int y, unsigned char *z)
17
{
18
  int a, b;
19
  float c[2048][4];
20
 
21
  switch (x)
22
    {
23
    case 0x1906:
24
      a = b = -1;
25
      break;
26
    case 0x190A:
27
      a = b = -1;
28
      break;
29
    case 0x8049:
30
      a = b = -1;
31
      break;
32
    case 0x1907:
33
      a = 1;
34
      b = 2;
35
      break;
36
    default:
37
      return;
38
    }
39
 
40
  if (a >= 0)
41
    {
42
      unsigned char *d = z;
43
      unsigned int i;
44
      for (i = 0; i < n; i++)
45
        {
46
          do
47
            {
48
              union
49
              {
50
                float r;
51
                unsigned int i;
52
              }
53
              e;
54
              e.r = c[i][1];
55
              d[a] =
56
                ((e.i >= 0x3f7f0000) ? ((int) e.i <
57
                                            0) ? (unsigned char) 0
58
                 : (unsigned char) 255 : (e.r =
59
                                          e.r * (255.0F / 256.0F) +
60
                                          32768.0F, (unsigned char) e.i));
61
            }
62
          while (0);
63
          d += y;
64
        }
65
    }
66
 
67
  if (b >= 0)
68
    {
69
      unsigned char *d = z;
70
      unsigned int i;
71
      for (i = 0; i < n; i++)
72
        {
73
          do
74
            {
75
              union
76
              {
77
                float r;
78
                unsigned int i;
79
              }
80
              e;
81
              e.r = c[i][2];
82
              d[b] =
83
                ((e.i >= 0x3f7f0000) ? ((int) e.i <
84
                                            0) ? (unsigned char) 0
85
                 : (unsigned char) 255 : (e.r =
86
                                          e.r * (255.0F / 256.0F) +
87
                                          32768.0F, (unsigned char) e.i));
88
            }
89
          while (0);
90
          d += y;
91
        }
92
    }
93
}

powered by: WebSVN 2.1.0

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