summaryrefslogtreecommitdiff
path: root/recipes/gcc/gcc-4.3.3/gcc-release-branch/PR-36500-fix-neon.patch
blob: 971dfe7e292d1bfee4e5ef3214b79e03a1b71a01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
--- foo/gcc/config/arm/arm.c	2008/06/11 10:51:34	136660
+++ foo/gcc/config/arm/arm.c	2008/06/11 10:52:55	136661
@@ -14830,124 +14830,190 @@
 {
   unsigned int i, fcode = ARM_BUILTIN_NEON_BASE;
 
+  tree neon_intQI_type_node;
+  tree neon_intHI_type_node;
+  tree neon_polyQI_type_node;
+  tree neon_polyHI_type_node;
+  tree neon_intSI_type_node;
+  tree neon_intDI_type_node;
+  tree neon_float_type_node;
+
+  tree intQI_pointer_node;
+  tree intHI_pointer_node;
+  tree intSI_pointer_node;
+  tree intDI_pointer_node;
+  tree float_pointer_node;
+
+  tree const_intQI_node;
+  tree const_intHI_node;
+  tree const_intSI_node;
+  tree const_intDI_node;
+  tree const_float_node;
+
+  tree const_intQI_pointer_node;
+  tree const_intHI_pointer_node;
+  tree const_intSI_pointer_node;
+  tree const_intDI_pointer_node;
+  tree const_float_pointer_node;
+
+  tree V8QI_type_node;
+  tree V4HI_type_node;
+  tree V2SI_type_node;
+  tree V2SF_type_node;
+  tree V16QI_type_node;
+  tree V8HI_type_node;
+  tree V4SI_type_node;
+  tree V4SF_type_node;
+  tree V2DI_type_node;
+
+  tree intUQI_type_node;
+  tree intUHI_type_node;
+  tree intUSI_type_node;
+  tree intUDI_type_node;
+
+  tree intEI_type_node;
+  tree intOI_type_node;
+  tree intCI_type_node;
+  tree intXI_type_node;
+
+  tree V8QI_pointer_node;
+  tree V4HI_pointer_node;
+  tree V2SI_pointer_node;
+  tree V2SF_pointer_node;
+  tree V16QI_pointer_node;
+  tree V8HI_pointer_node;
+  tree V4SI_pointer_node;
+  tree V4SF_pointer_node;
+  tree V2DI_pointer_node;
+
+  tree void_ftype_pv8qi_v8qi_v8qi;
+  tree void_ftype_pv4hi_v4hi_v4hi;
+  tree void_ftype_pv2si_v2si_v2si;
+  tree void_ftype_pv2sf_v2sf_v2sf;
+  tree void_ftype_pdi_di_di;
+  tree void_ftype_pv16qi_v16qi_v16qi;
+  tree void_ftype_pv8hi_v8hi_v8hi;
+  tree void_ftype_pv4si_v4si_v4si;
+  tree void_ftype_pv4sf_v4sf_v4sf;
+  tree void_ftype_pv2di_v2di_v2di;
+
+  tree reinterp_ftype_dreg[5][5];
+  tree reinterp_ftype_qreg[5][5];
+  tree dreg_types[5], qreg_types[5];
+
   /* Create distinguished type nodes for NEON vector element types,
      and pointers to values of such types, so we can detect them later.  */
-  tree neon_intQI_type_node = make_signed_type (GET_MODE_PRECISION (QImode));
-  tree neon_intHI_type_node = make_signed_type (GET_MODE_PRECISION (HImode));
-  tree neon_polyQI_type_node = make_signed_type (GET_MODE_PRECISION (QImode));
-  tree neon_polyHI_type_node = make_signed_type (GET_MODE_PRECISION (HImode));
-  tree neon_intSI_type_node = make_signed_type (GET_MODE_PRECISION (SImode));
-  tree neon_intDI_type_node = make_signed_type (GET_MODE_PRECISION (DImode));
-  tree neon_float_type_node = make_node (REAL_TYPE);
-
-  tree intQI_pointer_node = build_pointer_type (neon_intQI_type_node);
-  tree intHI_pointer_node = build_pointer_type (neon_intHI_type_node);
-  tree intSI_pointer_node = build_pointer_type (neon_intSI_type_node);
-  tree intDI_pointer_node = build_pointer_type (neon_intDI_type_node);
-  tree float_pointer_node = build_pointer_type (neon_float_type_node);
+  neon_intQI_type_node = make_signed_type (GET_MODE_PRECISION (QImode));
+  neon_intHI_type_node = make_signed_type (GET_MODE_PRECISION (HImode));
+  neon_polyQI_type_node = make_signed_type (GET_MODE_PRECISION (QImode));
+  neon_polyHI_type_node = make_signed_type (GET_MODE_PRECISION (HImode));
+  neon_intSI_type_node = make_signed_type (GET_MODE_PRECISION (SImode));
+  neon_intDI_type_node = make_signed_type (GET_MODE_PRECISION (DImode));
+  neon_float_type_node = make_node (REAL_TYPE);
+  TYPE_PRECISION (neon_float_type_node) = FLOAT_TYPE_SIZE;
+  layout_type (neon_float_type_node);
+
+  intQI_pointer_node = build_pointer_type (neon_intQI_type_node);
+  intHI_pointer_node = build_pointer_type (neon_intHI_type_node);
+  intSI_pointer_node = build_pointer_type (neon_intSI_type_node);
+  intDI_pointer_node = build_pointer_type (neon_intDI_type_node);
+  float_pointer_node = build_pointer_type (neon_float_type_node);
 
   /* Next create constant-qualified versions of the above types.  */
-  tree const_intQI_node = build_qualified_type (neon_intQI_type_node,
-						TYPE_QUAL_CONST);
-  tree const_intHI_node = build_qualified_type (neon_intHI_type_node,
-						TYPE_QUAL_CONST);
-  tree const_intSI_node = build_qualified_type (neon_intSI_type_node,
-						TYPE_QUAL_CONST);
-  tree const_intDI_node = build_qualified_type (neon_intDI_type_node,
-						TYPE_QUAL_CONST);
-  tree const_float_node = build_qualified_type (neon_float_type_node,
-						TYPE_QUAL_CONST);
-
-  tree const_intQI_pointer_node = build_pointer_type (const_intQI_node);
-  tree const_intHI_pointer_node = build_pointer_type (const_intHI_node);
-  tree const_intSI_pointer_node = build_pointer_type (const_intSI_node);
-  tree const_intDI_pointer_node = build_pointer_type (const_intDI_node);
-  tree const_float_pointer_node = build_pointer_type (const_float_node);
+  const_intQI_node = build_qualified_type (neon_intQI_type_node,
+					   TYPE_QUAL_CONST);
+  const_intHI_node = build_qualified_type (neon_intHI_type_node,
+					   TYPE_QUAL_CONST);
+  const_intSI_node = build_qualified_type (neon_intSI_type_node,
+					   TYPE_QUAL_CONST);
+  const_intDI_node = build_qualified_type (neon_intDI_type_node,
+					   TYPE_QUAL_CONST);
+  const_float_node = build_qualified_type (neon_float_type_node,
+					   TYPE_QUAL_CONST);
+
+  const_intQI_pointer_node = build_pointer_type (const_intQI_node);
+  const_intHI_pointer_node = build_pointer_type (const_intHI_node);
+  const_intSI_pointer_node = build_pointer_type (const_intSI_node);
+  const_intDI_pointer_node = build_pointer_type (const_intDI_node);
+  const_float_pointer_node = build_pointer_type (const_float_node);
 
   /* Now create vector types based on our NEON element types.  */
   /* 64-bit vectors.  */
-  tree V8QI_type_node =
+  V8QI_type_node =
     build_vector_type_for_mode (neon_intQI_type_node, V8QImode);
-  tree V4HI_type_node =
+  V4HI_type_node =
     build_vector_type_for_mode (neon_intHI_type_node, V4HImode);
-  tree V2SI_type_node =
+  V2SI_type_node =
     build_vector_type_for_mode (neon_intSI_type_node, V2SImode);
-  tree V2SF_type_node =
+  V2SF_type_node =
     build_vector_type_for_mode (neon_float_type_node, V2SFmode);
   /* 128-bit vectors.  */
-  tree V16QI_type_node =
+  V16QI_type_node =
     build_vector_type_for_mode (neon_intQI_type_node, V16QImode);
-  tree V8HI_type_node =
+  V8HI_type_node =
     build_vector_type_for_mode (neon_intHI_type_node, V8HImode);
-  tree V4SI_type_node =
+  V4SI_type_node =
     build_vector_type_for_mode (neon_intSI_type_node, V4SImode);
-  tree V4SF_type_node =
+  V4SF_type_node =
     build_vector_type_for_mode (neon_float_type_node, V4SFmode);
-  tree V2DI_type_node =
+  V2DI_type_node =
     build_vector_type_for_mode (neon_intDI_type_node, V2DImode);
 
   /* Unsigned integer types for various mode sizes.  */
-  tree intUQI_type_node = make_unsigned_type (GET_MODE_PRECISION (QImode));
-  tree intUHI_type_node = make_unsigned_type (GET_MODE_PRECISION (HImode));
-  tree intUSI_type_node = make_unsigned_type (GET_MODE_PRECISION (SImode));
-  tree intUDI_type_node = make_unsigned_type (GET_MODE_PRECISION (DImode));
+  intUQI_type_node = make_unsigned_type (GET_MODE_PRECISION (QImode));
+  intUHI_type_node = make_unsigned_type (GET_MODE_PRECISION (HImode));
+  intUSI_type_node = make_unsigned_type (GET_MODE_PRECISION (SImode));
+  intUDI_type_node = make_unsigned_type (GET_MODE_PRECISION (DImode));
 
   /* Opaque integer types for structures of vectors.  */
-  tree intEI_type_node = make_signed_type (GET_MODE_PRECISION (EImode));
-  tree intOI_type_node = make_signed_type (GET_MODE_PRECISION (OImode));
-  tree intCI_type_node = make_signed_type (GET_MODE_PRECISION (CImode));
-  tree intXI_type_node = make_signed_type (GET_MODE_PRECISION (XImode));
+  intEI_type_node = make_signed_type (GET_MODE_PRECISION (EImode));
+  intOI_type_node = make_signed_type (GET_MODE_PRECISION (OImode));
+  intCI_type_node = make_signed_type (GET_MODE_PRECISION (CImode));
+  intXI_type_node = make_signed_type (GET_MODE_PRECISION (XImode));
 
   /* Pointers to vector types.  */
-  tree V8QI_pointer_node = build_pointer_type (V8QI_type_node);
-  tree V4HI_pointer_node = build_pointer_type (V4HI_type_node);
-  tree V2SI_pointer_node = build_pointer_type (V2SI_type_node);
-  tree V2SF_pointer_node = build_pointer_type (V2SF_type_node);
-  tree V16QI_pointer_node = build_pointer_type (V16QI_type_node);
-  tree V8HI_pointer_node = build_pointer_type (V8HI_type_node);
-  tree V4SI_pointer_node = build_pointer_type (V4SI_type_node);
-  tree V4SF_pointer_node = build_pointer_type (V4SF_type_node);
-  tree V2DI_pointer_node = build_pointer_type (V2DI_type_node);
+  V8QI_pointer_node = build_pointer_type (V8QI_type_node);
+  V4HI_pointer_node = build_pointer_type (V4HI_type_node);
+  V2SI_pointer_node = build_pointer_type (V2SI_type_node);
+  V2SF_pointer_node = build_pointer_type (V2SF_type_node);
+  V16QI_pointer_node = build_pointer_type (V16QI_type_node);
+  V8HI_pointer_node = build_pointer_type (V8HI_type_node);
+  V4SI_pointer_node = build_pointer_type (V4SI_type_node);
+  V4SF_pointer_node = build_pointer_type (V4SF_type_node);
+  V2DI_pointer_node = build_pointer_type (V2DI_type_node);
 
   /* Operations which return results as pairs.  */
-  tree void_ftype_pv8qi_v8qi_v8qi =
+  void_ftype_pv8qi_v8qi_v8qi =
     build_function_type_list (void_type_node, V8QI_pointer_node, V8QI_type_node,
   			      V8QI_type_node, NULL);
-  tree void_ftype_pv4hi_v4hi_v4hi =
+  void_ftype_pv4hi_v4hi_v4hi =
     build_function_type_list (void_type_node, V4HI_pointer_node, V4HI_type_node,
   			      V4HI_type_node, NULL);
-  tree void_ftype_pv2si_v2si_v2si =
+  void_ftype_pv2si_v2si_v2si =
     build_function_type_list (void_type_node, V2SI_pointer_node, V2SI_type_node,
   			      V2SI_type_node, NULL);
-  tree void_ftype_pv2sf_v2sf_v2sf =
+  void_ftype_pv2sf_v2sf_v2sf =
     build_function_type_list (void_type_node, V2SF_pointer_node, V2SF_type_node,
   			      V2SF_type_node, NULL);
-  tree void_ftype_pdi_di_di =
+  void_ftype_pdi_di_di =
     build_function_type_list (void_type_node, intDI_pointer_node,
 			      neon_intDI_type_node, neon_intDI_type_node, NULL);
-  tree void_ftype_pv16qi_v16qi_v16qi =
+  void_ftype_pv16qi_v16qi_v16qi =
     build_function_type_list (void_type_node, V16QI_pointer_node,
 			      V16QI_type_node, V16QI_type_node, NULL);
-  tree void_ftype_pv8hi_v8hi_v8hi =
+  void_ftype_pv8hi_v8hi_v8hi =
     build_function_type_list (void_type_node, V8HI_pointer_node, V8HI_type_node,
   			      V8HI_type_node, NULL);
-  tree void_ftype_pv4si_v4si_v4si =
+  void_ftype_pv4si_v4si_v4si =
     build_function_type_list (void_type_node, V4SI_pointer_node, V4SI_type_node,
   			      V4SI_type_node, NULL);
-  tree void_ftype_pv4sf_v4sf_v4sf =
+  void_ftype_pv4sf_v4sf_v4sf =
     build_function_type_list (void_type_node, V4SF_pointer_node, V4SF_type_node,
   			      V4SF_type_node, NULL);
-  tree void_ftype_pv2di_v2di_v2di =
+  void_ftype_pv2di_v2di_v2di =
     build_function_type_list (void_type_node, V2DI_pointer_node, V2DI_type_node,
 			      V2DI_type_node, NULL);
 
-  tree reinterp_ftype_dreg[5][5];
-  tree reinterp_ftype_qreg[5][5];
-  tree dreg_types[5], qreg_types[5];
-
-  TYPE_PRECISION (neon_float_type_node) = FLOAT_TYPE_SIZE;
-  layout_type (neon_float_type_node);
-
   /* Define typedefs which exactly correspond to the modes we are basing vector
      types on.  If you change these names you'll need to change
      the table used by arm_mangle_type too.  */