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

Subversion Repositories openrisc

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

powered by: WebSVN 2.1.0

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