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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr42833.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
typedef __INT_LEAST8_TYPE__ int8_t;
2
typedef __UINT_LEAST32_TYPE__ uint32_t;
3
typedef int ssize_t;
4
typedef struct { int8_t v1; int8_t v2; int8_t v3; int8_t v4; } neon_s8;
5
 
6
uint32_t helper_neon_rshl_s8 (uint32_t arg1, uint32_t arg2);
7
 
8
uint32_t
9
helper_neon_rshl_s8 (uint32_t arg1, uint32_t arg2)
10
{
11
  uint32_t res;
12
  neon_s8 vsrc1;
13
  neon_s8 vsrc2;
14
  neon_s8 vdest;
15
  do
16
    {
17
      union
18
      {
19
        neon_s8 v;
20
        uint32_t i;
21
      } conv_u;
22
      conv_u.i = (arg1);
23
      vsrc1 = conv_u.v;
24
    }
25
  while (0);
26
  do
27
    {
28
      union
29
      {
30
        neon_s8 v;
31
        uint32_t i;
32
      } conv_u;
33
      conv_u.i = (arg2);
34
      vsrc2 = conv_u.v;
35
    }
36
  while (0);
37
  do
38
    {
39
      int8_t tmp;
40
      tmp = (int8_t) vsrc2.v1;
41
      if (tmp >= (ssize_t) sizeof (vsrc1.v1) * 8)
42
        {
43
          vdest.v1 = 0;
44
        }
45
      else if (tmp < -(ssize_t) sizeof (vsrc1.v1) * 8)
46
        {
47
          vdest.v1 = vsrc1.v1 >> (sizeof (vsrc1.v1) * 8 - 1);
48
        }
49
      else if (tmp == -(ssize_t) sizeof (vsrc1.v1) * 8)
50
        {
51
          vdest.v1 = vsrc1.v1 >> (tmp - 1);
52
          vdest.v1++;
53
          vdest.v1 >>= 1;
54
        }
55
      else if (tmp < 0)
56
        {
57
          vdest.v1 = (vsrc1.v1 + (1 << (-1 - tmp))) >> -tmp;
58
        }
59
      else
60
        {
61
          vdest.v1 = vsrc1.v1 << tmp;
62
        }
63
    }
64
  while (0);
65
  do
66
    {
67
      int8_t tmp;
68
      tmp = (int8_t) vsrc2.v2;
69
      if (tmp >= (ssize_t) sizeof (vsrc1.v2) * 8)
70
        {
71
          vdest.v2 = 0;
72
        }
73
      else if (tmp < -(ssize_t) sizeof (vsrc1.v2) * 8)
74
        {
75
          vdest.v2 = vsrc1.v2 >> (sizeof (vsrc1.v2) * 8 - 1);
76
        }
77
      else if (tmp == -(ssize_t) sizeof (vsrc1.v2) * 8)
78
        {
79
          vdest.v2 = vsrc1.v2 >> (tmp - 1);
80
          vdest.v2++;
81
          vdest.v2 >>= 1;
82
        }
83
      else if (tmp < 0)
84
        {
85
          vdest.v2 = (vsrc1.v2 + (1 << (-1 - tmp))) >> -tmp;
86
        }
87
      else
88
        {
89
          vdest.v2 = vsrc1.v2 << tmp;
90
        }
91
    }
92
  while (0);
93
  do
94
    {
95
      int8_t tmp;
96
      tmp = (int8_t) vsrc2.v3;
97
      if (tmp >= (ssize_t) sizeof (vsrc1.v3) * 8)
98
        {
99
          vdest.v3 = 0;
100
        }
101
      else if (tmp < -(ssize_t) sizeof (vsrc1.v3) * 8)
102
        {
103
          vdest.v3 = vsrc1.v3 >> (sizeof (vsrc1.v3) * 8 - 1);
104
        }
105
      else if (tmp == -(ssize_t) sizeof (vsrc1.v3) * 8)
106
        {
107
          vdest.v3 = vsrc1.v3 >> (tmp - 1);
108
          vdest.v3++;
109
          vdest.v3 >>= 1;
110
        }
111
      else if (tmp < 0)
112
        {
113
          vdest.v3 = (vsrc1.v3 + (1 << (-1 - tmp))) >> -tmp;
114
        }
115
      else
116
        {
117
          vdest.v3 = vsrc1.v3 << tmp;
118
        }
119
    }
120
  while (0);
121
  do
122
    {
123
      int8_t tmp;
124
      tmp = (int8_t) vsrc2.v4;
125
      if (tmp >= (ssize_t) sizeof (vsrc1.v4) * 8)
126
        {
127
          vdest.v4 = 0;
128
        }
129
      else if (tmp < -(ssize_t) sizeof (vsrc1.v4) * 8)
130
        {
131
          vdest.v4 = vsrc1.v4 >> (sizeof (vsrc1.v4) * 8 - 1);
132
        }
133
      else if (tmp == -(ssize_t) sizeof (vsrc1.v4) * 8)
134
        {
135
          vdest.v4 = vsrc1.v4 >> (tmp - 1);
136
          vdest.v4++;
137
          vdest.v4 >>= 1;
138
        }
139
      else if (tmp < 0)
140
        {
141
          vdest.v4 = (vsrc1.v4 + (1 << (-1 - tmp))) >> -tmp;
142
        }
143
      else
144
        {
145
          vdest.v4 = vsrc1.v4 << tmp;
146
        }
147
    }
148
  while (0);;
149
  do
150
    {
151
      union
152
      {
153
        neon_s8 v;
154
        uint32_t i;
155
      } conv_u;
156
      conv_u.v = (vdest);
157
      res = conv_u.i;
158
    }
159
  while (0);
160
  return res;
161
}
162
 
163
extern void abort(void);
164
 
165
int main()
166
{
167
  uint32_t r = helper_neon_rshl_s8 (0x05050505, 0x01010101);
168
  if (r != 0x0a0a0a0a)
169
    abort ();
170
  return 0;
171
}

powered by: WebSVN 2.1.0

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