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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [config/] [rs6000/] [spe.h] - Blame information for rev 709

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 709 jeremybenn
/* PowerPC E500 user include file.
2
   Copyright (C) 2002, 2003, 2004, 2009 Free Software Foundation, Inc.
3
   Contributed by Aldy Hernandez (aldyh@redhat.com).
4
 
5
   This file is part of GCC.
6
 
7
   GCC is free software; you can redistribute it and/or modify it
8
   under the terms of the GNU General Public License as published
9
   by the Free Software Foundation; either version 3, or (at your
10
   option) any later version.
11
 
12
   GCC is distributed in the hope that it will be useful, but WITHOUT
13
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15
   License for more details.
16
 
17
   Under Section 7 of GPL version 3, you are granted additional
18
   permissions described in the GCC Runtime Library Exception, version
19
   3.1, as published by the Free Software Foundation.
20
 
21
   You should have received a copy of the GNU General Public License and
22
   a copy of the GCC Runtime Library Exception along with this program;
23
   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
24
   <http://www.gnu.org/licenses/>.  */
25
 
26
#ifndef _SPE_H
27
#define _SPE_H
28
 
29
#define __vector __attribute__((vector_size(8)))
30
 
31
typedef int                     int32_t;
32
typedef unsigned                uint32_t;
33
typedef short                   int16_t;
34
typedef unsigned short          uint16_t;
35
typedef long long               int64_t;
36
typedef unsigned long long      uint64_t;
37
 
38
typedef short                   __vector __ev64_s16__;
39
typedef unsigned short          __vector __ev64_u16__;
40
typedef int                     __vector __ev64_s32__;
41
typedef unsigned                __vector __ev64_u32__;
42
typedef long long               __vector __ev64_s64__;
43
typedef unsigned long long      __vector __ev64_u64__;
44
typedef float                   __vector __ev64_fs__;
45
 
46
#define __v2si __ev64_opaque__
47
#define __v2sf __ev64_fs__
48
 
49
#define __ev_addw __builtin_spe_evaddw
50
#define __ev_addiw __builtin_spe_evaddiw
51
#define __ev_subfw(a,b) __builtin_spe_evsubfw ((b), (a))
52
#define __ev_subw __builtin_spe_evsubfw
53
#define __ev_subifw(a,b) __builtin_spe_evsubifw ((b), (a))
54
#define __ev_subiw __builtin_spe_evsubifw
55
#define __ev_abs __builtin_spe_evabs
56
#define __ev_neg __builtin_spe_evneg
57
#define __ev_extsb __builtin_spe_evextsb
58
#define __ev_extsh __builtin_spe_evextsh
59
#define __ev_and __builtin_spe_evand
60
#define __ev_or __builtin_spe_evor
61
#define __ev_xor __builtin_spe_evxor
62
#define __ev_nand __builtin_spe_evnand
63
#define __ev_nor __builtin_spe_evnor
64
#define __ev_eqv __builtin_spe_eveqv
65
#define __ev_andc __builtin_spe_evandc
66
#define __ev_orc __builtin_spe_evorc
67
#define __ev_rlw __builtin_spe_evrlw
68
#define __ev_rlwi __builtin_spe_evrlwi
69
#define __ev_slw __builtin_spe_evslw
70
#define __ev_slwi __builtin_spe_evslwi
71
#define __ev_srws __builtin_spe_evsrws
72
#define __ev_srwu __builtin_spe_evsrwu
73
#define __ev_srwis __builtin_spe_evsrwis
74
#define __ev_srwiu __builtin_spe_evsrwiu
75
#define __ev_cntlzw __builtin_spe_evcntlzw
76
#define __ev_cntlsw __builtin_spe_evcntlsw
77
#define __ev_rndw __builtin_spe_evrndw
78
#define __ev_mergehi __builtin_spe_evmergehi
79
#define __ev_mergelo __builtin_spe_evmergelo
80
#define __ev_mergelohi __builtin_spe_evmergelohi
81
#define __ev_mergehilo __builtin_spe_evmergehilo
82
#define __ev_splati __builtin_spe_evsplati
83
#define __ev_splatfi __builtin_spe_evsplatfi
84
#define __ev_divws __builtin_spe_evdivws
85
#define __ev_divwu __builtin_spe_evdivwu
86
#define __ev_mra __builtin_spe_evmra
87
 
88
#define __brinc __builtin_spe_brinc
89
 
90
/* Loads.  */
91
 
92
#define __ev_lddx __builtin_spe_evlddx
93
#define __ev_ldwx __builtin_spe_evldwx
94
#define __ev_ldhx __builtin_spe_evldhx
95
#define __ev_lwhex __builtin_spe_evlwhex
96
#define __ev_lwhoux __builtin_spe_evlwhoux
97
#define __ev_lwhosx __builtin_spe_evlwhosx
98
#define __ev_lwwsplatx __builtin_spe_evlwwsplatx
99
#define __ev_lwhsplatx __builtin_spe_evlwhsplatx
100
#define __ev_lhhesplatx __builtin_spe_evlhhesplatx
101
#define __ev_lhhousplatx __builtin_spe_evlhhousplatx
102
#define __ev_lhhossplatx __builtin_spe_evlhhossplatx
103
#define __ev_ldd __builtin_spe_evldd
104
#define __ev_ldw __builtin_spe_evldw
105
#define __ev_ldh __builtin_spe_evldh
106
#define __ev_lwhe __builtin_spe_evlwhe
107
#define __ev_lwhou __builtin_spe_evlwhou
108
#define __ev_lwhos __builtin_spe_evlwhos
109
#define __ev_lwwsplat __builtin_spe_evlwwsplat
110
#define __ev_lwhsplat __builtin_spe_evlwhsplat
111
#define __ev_lhhesplat __builtin_spe_evlhhesplat
112
#define __ev_lhhousplat __builtin_spe_evlhhousplat
113
#define __ev_lhhossplat __builtin_spe_evlhhossplat
114
 
115
/* Stores.  */
116
 
117
#define __ev_stddx __builtin_spe_evstddx
118
#define __ev_stdwx __builtin_spe_evstdwx
119
#define __ev_stdhx __builtin_spe_evstdhx
120
#define __ev_stwwex __builtin_spe_evstwwex
121
#define __ev_stwwox __builtin_spe_evstwwox
122
#define __ev_stwhex __builtin_spe_evstwhex
123
#define __ev_stwhox __builtin_spe_evstwhox
124
#define __ev_stdd __builtin_spe_evstdd
125
#define __ev_stdw __builtin_spe_evstdw
126
#define __ev_stdh __builtin_spe_evstdh
127
#define __ev_stwwe __builtin_spe_evstwwe
128
#define __ev_stwwo __builtin_spe_evstwwo
129
#define __ev_stwhe __builtin_spe_evstwhe
130
#define __ev_stwho __builtin_spe_evstwho
131
 
132
/* Fixed point complex.  */
133
 
134
#define __ev_mhossf __builtin_spe_evmhossf
135
#define __ev_mhosmf __builtin_spe_evmhosmf
136
#define __ev_mhosmi __builtin_spe_evmhosmi
137
#define __ev_mhoumi __builtin_spe_evmhoumi
138
#define __ev_mhessf __builtin_spe_evmhessf
139
#define __ev_mhesmf __builtin_spe_evmhesmf
140
#define __ev_mhesmi __builtin_spe_evmhesmi
141
#define __ev_mheumi __builtin_spe_evmheumi
142
#define __ev_mhossfa __builtin_spe_evmhossfa
143
#define __ev_mhosmfa __builtin_spe_evmhosmfa
144
#define __ev_mhosmia __builtin_spe_evmhosmia
145
#define __ev_mhoumia __builtin_spe_evmhoumia
146
#define __ev_mhessfa __builtin_spe_evmhessfa
147
#define __ev_mhesmfa __builtin_spe_evmhesmfa
148
#define __ev_mhesmia __builtin_spe_evmhesmia
149
#define __ev_mheumia __builtin_spe_evmheumia
150
 
151
#define __ev_mhoumf __ev_mhoumi
152
#define __ev_mheumf __ev_mheumi
153
#define __ev_mhoumfa __ev_mhoumia
154
#define __ev_mheumfa __ev_mheumia
155
 
156
#define __ev_mhossfaaw __builtin_spe_evmhossfaaw
157
#define __ev_mhossiaaw __builtin_spe_evmhossiaaw
158
#define __ev_mhosmfaaw __builtin_spe_evmhosmfaaw
159
#define __ev_mhosmiaaw __builtin_spe_evmhosmiaaw
160
#define __ev_mhousiaaw __builtin_spe_evmhousiaaw
161
#define __ev_mhoumiaaw __builtin_spe_evmhoumiaaw
162
#define __ev_mhessfaaw __builtin_spe_evmhessfaaw
163
#define __ev_mhessiaaw __builtin_spe_evmhessiaaw
164
#define __ev_mhesmfaaw __builtin_spe_evmhesmfaaw
165
#define __ev_mhesmiaaw __builtin_spe_evmhesmiaaw
166
#define __ev_mheusiaaw __builtin_spe_evmheusiaaw
167
#define __ev_mheumiaaw __builtin_spe_evmheumiaaw
168
 
169
#define __ev_mhousfaaw __ev_mhousiaaw
170
#define __ev_mhoumfaaw __ev_mhoumiaaw
171
#define __ev_mheusfaaw __ev_mheusiaaw
172
#define __ev_mheumfaaw __ev_mheumiaaw
173
 
174
#define __ev_mhossfanw __builtin_spe_evmhossfanw
175
#define __ev_mhossianw __builtin_spe_evmhossianw
176
#define __ev_mhosmfanw __builtin_spe_evmhosmfanw
177
#define __ev_mhosmianw __builtin_spe_evmhosmianw
178
#define __ev_mhousianw __builtin_spe_evmhousianw
179
#define __ev_mhoumianw __builtin_spe_evmhoumianw
180
#define __ev_mhessfanw __builtin_spe_evmhessfanw
181
#define __ev_mhessianw __builtin_spe_evmhessianw
182
#define __ev_mhesmfanw __builtin_spe_evmhesmfanw
183
#define __ev_mhesmianw __builtin_spe_evmhesmianw
184
#define __ev_mheusianw __builtin_spe_evmheusianw
185
#define __ev_mheumianw __builtin_spe_evmheumianw
186
 
187
#define __ev_mhousfanw __ev_mhousianw
188
#define __ev_mhoumfanw __ev_mhoumianw
189
#define __ev_mheusfanw __ev_mheusianw
190
#define __ev_mheumfanw __ev_mheumianw
191
 
192
#define __ev_mhogsmfaa __builtin_spe_evmhogsmfaa
193
#define __ev_mhogsmiaa __builtin_spe_evmhogsmiaa
194
#define __ev_mhogumiaa __builtin_spe_evmhogumiaa
195
#define __ev_mhegsmfaa __builtin_spe_evmhegsmfaa
196
#define __ev_mhegsmiaa __builtin_spe_evmhegsmiaa
197
#define __ev_mhegumiaa __builtin_spe_evmhegumiaa
198
 
199
#define __ev_mhogumfaa __ev_mhogumiaa
200
#define __ev_mhegumfaa __ev_mhegumiaa
201
 
202
#define __ev_mhogsmfan __builtin_spe_evmhogsmfan
203
#define __ev_mhogsmian __builtin_spe_evmhogsmian
204
#define __ev_mhogumian __builtin_spe_evmhogumian
205
#define __ev_mhegsmfan __builtin_spe_evmhegsmfan
206
#define __ev_mhegsmian __builtin_spe_evmhegsmian
207
#define __ev_mhegumian __builtin_spe_evmhegumian
208
 
209
#define __ev_mhogumfan __ev_mhogumian
210
#define __ev_mhegumfan __ev_mhegumian
211
 
212
#define __ev_mwhssf __builtin_spe_evmwhssf
213
#define __ev_mwhsmf __builtin_spe_evmwhsmf
214
#define __ev_mwhsmi __builtin_spe_evmwhsmi
215
#define __ev_mwhumi __builtin_spe_evmwhumi
216
#define __ev_mwhssfa __builtin_spe_evmwhssfa
217
#define __ev_mwhsmfa __builtin_spe_evmwhsmfa
218
#define __ev_mwhsmia __builtin_spe_evmwhsmia
219
#define __ev_mwhumia __builtin_spe_evmwhumia
220
 
221
#define __ev_mwhumf __ev_mwhumi
222
#define __ev_mwhumfa __ev_mwhumia
223
 
224
#define __ev_mwlumi __builtin_spe_evmwlumi
225
#define __ev_mwlumia __builtin_spe_evmwlumia
226
#define __ev_mwlumiaaw __builtin_spe_evmwlumiaaw
227
 
228
#define __ev_mwlssiaaw __builtin_spe_evmwlssiaaw
229
#define __ev_mwlsmiaaw __builtin_spe_evmwlsmiaaw
230
#define __ev_mwlusiaaw __builtin_spe_evmwlusiaaw
231
#define __ev_mwlusiaaw __builtin_spe_evmwlusiaaw
232
 
233
#define __ev_mwlssianw __builtin_spe_evmwlssianw
234
#define __ev_mwlsmianw __builtin_spe_evmwlsmianw
235
#define __ev_mwlusianw __builtin_spe_evmwlusianw
236
#define __ev_mwlumianw __builtin_spe_evmwlumianw
237
 
238
#define __ev_mwssf __builtin_spe_evmwssf
239
#define __ev_mwsmf __builtin_spe_evmwsmf
240
#define __ev_mwsmi __builtin_spe_evmwsmi
241
#define __ev_mwumi __builtin_spe_evmwumi
242
#define __ev_mwssfa __builtin_spe_evmwssfa
243
#define __ev_mwsmfa __builtin_spe_evmwsmfa
244
#define __ev_mwsmia __builtin_spe_evmwsmia
245
#define __ev_mwumia __builtin_spe_evmwumia
246
 
247
#define __ev_mwumf __ev_mwumi
248
#define __ev_mwumfa __ev_mwumia
249
 
250
#define __ev_mwssfaa __builtin_spe_evmwssfaa
251
#define __ev_mwsmfaa __builtin_spe_evmwsmfaa
252
#define __ev_mwsmiaa __builtin_spe_evmwsmiaa
253
#define __ev_mwumiaa __builtin_spe_evmwumiaa
254
 
255
#define __ev_mwumfaa __ev_mwumiaa
256
 
257
#define __ev_mwssfan __builtin_spe_evmwssfan
258
#define __ev_mwsmfan __builtin_spe_evmwsmfan
259
#define __ev_mwsmian __builtin_spe_evmwsmian
260
#define __ev_mwumian __builtin_spe_evmwumian
261
 
262
#define __ev_mwumfan __ev_mwumian
263
 
264
#define __ev_addssiaaw __builtin_spe_evaddssiaaw
265
#define __ev_addsmiaaw __builtin_spe_evaddsmiaaw
266
#define __ev_addusiaaw __builtin_spe_evaddusiaaw
267
#define __ev_addumiaaw __builtin_spe_evaddumiaaw
268
 
269
#define __ev_addusfaaw __ev_addusiaaw
270
#define __ev_addumfaaw __ev_addumiaaw
271
#define __ev_addsmfaaw __ev_addsmiaaw
272
#define __ev_addssfaaw __ev_addssiaaw
273
 
274
#define __ev_subfssiaaw __builtin_spe_evsubfssiaaw
275
#define __ev_subfsmiaaw __builtin_spe_evsubfsmiaaw
276
#define __ev_subfusiaaw __builtin_spe_evsubfusiaaw
277
#define __ev_subfumiaaw __builtin_spe_evsubfumiaaw
278
 
279
#define __ev_subfusfaaw __ev_subfusiaaw
280
#define __ev_subfumfaaw __ev_subfumiaaw
281
#define __ev_subfsmfaaw __ev_subfsmiaaw
282
#define __ev_subfssfaaw __ev_subfssiaaw
283
 
284
/* Floating Point SIMD Instructions  */
285
 
286
#define __ev_fsabs __builtin_spe_evfsabs
287
#define __ev_fsnabs __builtin_spe_evfsnabs
288
#define __ev_fsneg __builtin_spe_evfsneg
289
#define __ev_fsadd __builtin_spe_evfsadd
290
#define __ev_fssub __builtin_spe_evfssub
291
#define __ev_fsmul __builtin_spe_evfsmul
292
#define __ev_fsdiv __builtin_spe_evfsdiv
293
#define __ev_fscfui __builtin_spe_evfscfui
294
#define __ev_fscfsi __builtin_spe_evfscfsi
295
#define __ev_fscfuf __builtin_spe_evfscfuf
296
#define __ev_fscfsf __builtin_spe_evfscfsf
297
#define __ev_fsctui __builtin_spe_evfsctui
298
#define __ev_fsctsi __builtin_spe_evfsctsi
299
#define __ev_fsctuf __builtin_spe_evfsctuf
300
#define __ev_fsctsf __builtin_spe_evfsctsf
301
#define __ev_fsctuiz __builtin_spe_evfsctuiz
302
#define __ev_fsctsiz __builtin_spe_evfsctsiz
303
 
304
/* NOT SUPPORTED IN FIRST e500, support via two instructions:  */
305
 
306
#define __ev_mwhusfaaw  __ev_mwhusiaaw
307
#define __ev_mwhumfaaw  __ev_mwhumiaaw
308
#define __ev_mwhusfanw  __ev_mwhusianw
309
#define __ev_mwhumfanw  __ev_mwhumianw
310
#define __ev_mwhgumfaa  __ev_mwhgumiaa
311
#define __ev_mwhgumfan  __ev_mwhgumian
312
 
313
#define __ev_mwhgssfaa __internal_ev_mwhgssfaa
314
#define __ev_mwhgsmfaa __internal_ev_mwhgsmfaa
315
#define __ev_mwhgsmiaa __internal_ev_mwhgsmiaa
316
#define __ev_mwhgumiaa __internal_ev_mwhgumiaa
317
#define __ev_mwhgssfan __internal_ev_mwhgssfan
318
#define __ev_mwhgsmfan __internal_ev_mwhgsmfan
319
#define __ev_mwhgsmian __internal_ev_mwhgsmian
320
#define __ev_mwhgumian __internal_ev_mwhgumian
321
#define __ev_mwhssiaaw __internal_ev_mwhssiaaw
322
#define __ev_mwhssfaaw __internal_ev_mwhssfaaw
323
#define __ev_mwhsmfaaw __internal_ev_mwhsmfaaw
324
#define __ev_mwhsmiaaw __internal_ev_mwhsmiaaw
325
#define __ev_mwhusiaaw __internal_ev_mwhusiaaw
326
#define __ev_mwhumiaaw __internal_ev_mwhumiaaw
327
#define __ev_mwhssfanw __internal_ev_mwhssfanw
328
#define __ev_mwhssianw __internal_ev_mwhssianw
329
#define __ev_mwhsmfanw __internal_ev_mwhsmfanw
330
#define __ev_mwhsmianw __internal_ev_mwhsmianw
331
#define __ev_mwhusianw __internal_ev_mwhusianw
332
#define __ev_mwhumianw __internal_ev_mwhumianw
333
 
334
static inline __ev64_opaque__
335
__internal_ev_mwhssfaaw (__ev64_opaque__ a, __ev64_opaque__ b)
336
{
337
  __ev64_opaque__ t;
338
 
339
  t = __ev_mwhssf (a, b);
340
  return __ev_addssiaaw (t);
341
}
342
 
343
static inline __ev64_opaque__
344
__internal_ev_mwhssiaaw (__ev64_opaque__ a, __ev64_opaque__ b)
345
{
346
  __ev64_opaque__ t;
347
 
348
  t = __ev_mwhsmi (a, b);
349
  return __ev_addssiaaw (t);
350
}
351
 
352
static inline __ev64_opaque__
353
__internal_ev_mwhsmfaaw (__ev64_opaque__ a, __ev64_opaque__ b)
354
{
355
  __ev64_opaque__ t;
356
 
357
  t = __ev_mwhsmf (a, b);
358
  return __ev_addsmiaaw (t);
359
}
360
 
361
static inline __ev64_opaque__
362
__internal_ev_mwhsmiaaw (__ev64_opaque__ a, __ev64_opaque__ b)
363
{
364
  __ev64_opaque__ t;
365
 
366
  t = __ev_mwhsmi (a, b);
367
  return __ev_addsmiaaw (t);
368
}
369
 
370
static inline __ev64_opaque__
371
__internal_ev_mwhusiaaw (__ev64_opaque__ a, __ev64_opaque__ b)
372
{
373
  __ev64_opaque__ t;
374
 
375
  t = __ev_mwhumi (a, b);
376
  return __ev_addusiaaw (t);
377
}
378
 
379
static inline __ev64_opaque__
380
__internal_ev_mwhumiaaw (__ev64_opaque__ a, __ev64_opaque__ b)
381
{
382
  __ev64_opaque__ t;
383
 
384
  t = __ev_mwhumi (a, b);
385
  return __ev_addumiaaw (t);
386
}
387
 
388
static inline __ev64_opaque__
389
__internal_ev_mwhssfanw (__ev64_opaque__ a, __ev64_opaque__ b)
390
{
391
  __ev64_opaque__ t;
392
 
393
  t = __ev_mwhssf (a, b);
394
  return __ev_subfssiaaw (t);
395
}
396
 
397
static inline __ev64_opaque__
398
__internal_ev_mwhssianw (__ev64_opaque__ a, __ev64_opaque__ b)
399
{
400
  __ev64_opaque__ t;
401
 
402
  t = __ev_mwhsmi (a, b);
403
  return __ev_subfssiaaw (t);
404
}
405
 
406
static inline __ev64_opaque__
407
__internal_ev_mwhsmfanw (__ev64_opaque__ a, __ev64_opaque__ b)
408
{
409
  __ev64_opaque__ t;
410
 
411
  t = __ev_mwhsmf (a, b);
412
  return __ev_subfsmiaaw (t);
413
}
414
 
415
static inline __ev64_opaque__
416
__internal_ev_mwhsmianw (__ev64_opaque__ a, __ev64_opaque__ b)
417
{
418
  __ev64_opaque__ t;
419
 
420
  t = __ev_mwhsmi (a, b);
421
  return __ev_subfsmiaaw (t);
422
}
423
 
424
static inline __ev64_opaque__
425
__internal_ev_mwhusianw (__ev64_opaque__ a, __ev64_opaque__ b)
426
{
427
  __ev64_opaque__ t;
428
 
429
  t = __ev_mwhumi (a, b);
430
  return __ev_subfusiaaw (t);
431
}
432
 
433
static inline __ev64_opaque__
434
__internal_ev_mwhumianw (__ev64_opaque__ a, __ev64_opaque__ b)
435
{
436
  __ev64_opaque__ t;
437
 
438
  t = __ev_mwhumi (a, b);
439
  return __ev_subfumiaaw (t);
440
}
441
 
442
static inline __ev64_opaque__
443
__internal_ev_mwhgssfaa (__ev64_opaque__ a, __ev64_opaque__ b)
444
{
445
  __ev64_opaque__ t;
446
 
447
  t = __ev_mwhssf (a, b);
448
  return __ev_mwsmiaa (t, ((__ev64_s32__){1, 1}));
449
}
450
 
451
static inline __ev64_opaque__
452
__internal_ev_mwhgsmfaa (__ev64_opaque__ a, __ev64_opaque__ b)
453
{
454
  __ev64_opaque__ t;
455
 
456
  t = __ev_mwhsmf (a, b);
457
  return __ev_mwsmiaa (t, ((__ev64_s32__){1, 1}));
458
}
459
 
460
static inline __ev64_opaque__
461
__internal_ev_mwhgsmiaa (__ev64_opaque__ a, __ev64_opaque__ b)
462
{
463
  __ev64_opaque__ t;
464
 
465
  t = __ev_mwhsmi (a, b);
466
  return __ev_mwsmiaa (t, ((__ev64_s32__){1, 1}));
467
}
468
 
469
static inline __ev64_opaque__
470
__internal_ev_mwhgumiaa (__ev64_opaque__ a, __ev64_opaque__ b)
471
{
472
  __ev64_opaque__ t;
473
 
474
  t = __ev_mwhumi (a, b);
475
  return __ev_mwumiaa (t, ((__ev64_s32__){1, 1}));
476
}
477
 
478
static inline __ev64_opaque__
479
__internal_ev_mwhgssfan (__ev64_opaque__ a, __ev64_opaque__ b)
480
{
481
  __ev64_opaque__ t;
482
 
483
  t = __ev_mwhssf (a, b);
484
  return __ev_mwsmian (t, ((__ev64_s32__){1, 1}));
485
}
486
 
487
static inline __ev64_opaque__
488
__internal_ev_mwhgsmfan (__ev64_opaque__ a, __ev64_opaque__ b)
489
{
490
  __ev64_opaque__ t;
491
 
492
  t = __ev_mwhsmf (a, b);
493
  return __ev_mwsmian (t, ((__ev64_s32__){1, 1}));
494
}
495
 
496
static inline __ev64_opaque__
497
__internal_ev_mwhgsmian (__ev64_opaque__ a, __ev64_opaque__ b)
498
{
499
  __ev64_opaque__ t;
500
 
501
  t = __ev_mwhsmi (a, b);
502
  return __ev_mwsmian (t, ((__ev64_s32__){1, 1}));
503
}
504
 
505
static inline __ev64_opaque__
506
__internal_ev_mwhgumian (__ev64_opaque__ a, __ev64_opaque__ b)
507
{
508
  __ev64_opaque__ t;
509
 
510
  t = __ev_mwhumi (a, b);
511
  return __ev_mwumian (t, ((__ev64_s32__){1, 1}));
512
}
513
 
514
/* END OF NOT SUPPORTED */
515
 
516
/* __ev_create* functions.  */
517
 
518
#define __ev_create_ufix32_u32 __ev_create_u32
519
#define __ev_create_sfix32_s32 __ev_create_s32
520
 
521
static inline __ev64_opaque__
522
__ev_create_s16 (int16_t a, int16_t b, int16_t c, int16_t d)
523
{
524
  union
525
  {
526
    __ev64_opaque__ v;
527
    int16_t i[4];
528
  } u;
529
 
530
  u.i[0] = a;
531
  u.i[1] = b;
532
  u.i[2] = c;
533
  u.i[3] = d;
534
 
535
  return u.v;
536
}
537
 
538
static inline __ev64_opaque__
539
__ev_create_u16 (uint16_t a, uint16_t b, uint16_t c, uint16_t d)
540
 
541
{
542
  union
543
  {
544
    __ev64_opaque__ v;
545
    uint16_t i[4];
546
  } u;
547
 
548
  u.i[0] = a;
549
  u.i[1] = b;
550
  u.i[2] = c;
551
  u.i[3] = d;
552
 
553
  return u.v;
554
}
555
 
556
static inline __ev64_opaque__
557
__ev_create_s32 (int32_t a, int32_t b)
558
{
559
  union
560
  {
561
    __ev64_opaque__ v;
562
   int32_t i[2];
563
  } u;
564
 
565
  u.i[0] = a;
566
  u.i[1] = b;
567
 
568
  return u.v;
569
}
570
 
571
static inline __ev64_opaque__
572
__ev_create_u32 (uint32_t a, uint32_t b)
573
{
574
  union
575
  {
576
    __ev64_opaque__ v;
577
    uint32_t i[2];
578
  } u;
579
 
580
  u.i[0] = a;
581
  u.i[1] = b;
582
 
583
  return u.v;
584
}
585
 
586
static inline __ev64_opaque__
587
__ev_create_fs (float a, float b)
588
{
589
  union
590
  {
591
    __ev64_opaque__ v;
592
    float f[2];
593
  } u;
594
 
595
  u.f[0] = a;
596
  u.f[1] = b;
597
 
598
  return u.v;
599
}
600
 
601
static inline __ev64_opaque__
602
__ev_create_sfix32_fs (float a, float b)
603
{
604
  __ev64_opaque__ ev;
605
 
606
  ev = (__ev64_opaque__) __ev_create_fs (a, b);
607
  return (__ev64_opaque__) __builtin_spe_evfsctsf ((__v2sf) ev);
608
}
609
 
610
static inline __ev64_opaque__
611
__ev_create_ufix32_fs (float a, float b)
612
{
613
  __ev64_opaque__ ev;
614
 
615
  ev = (__ev64_opaque__) __ev_create_fs (a, b);
616
  return (__ev64_opaque__) __builtin_spe_evfsctuf ((__v2sf) ev);
617
}
618
 
619
static inline __ev64_opaque__
620
__ev_create_s64 (int64_t a)
621
{
622
  union
623
  {
624
    __ev64_opaque__ v;
625
    int64_t i;
626
  } u;
627
 
628
  u.i = a;
629
  return u.v;
630
}
631
 
632
static inline __ev64_opaque__
633
__ev_create_u64 (uint64_t a)
634
{
635
  union
636
  {
637
    __ev64_opaque__ v;
638
    uint64_t i;
639
  } u;
640
 
641
  u.i = a;
642
  return u.v;
643
}
644
 
645
static inline uint64_t
646
__ev_convert_u64 (__ev64_opaque__ a)
647
{
648
  return (uint64_t) a;
649
}
650
 
651
static inline int64_t
652
__ev_convert_s64 (__ev64_opaque__ a)
653
{
654
  return (int64_t) a;
655
}
656
 
657
/* __ev_get_* functions.  */
658
 
659
#define __ev_get_upper_u32(a) __ev_get_u32_internal ((a), 0)
660
#define __ev_get_lower_u32(a) __ev_get_u32_internal ((a), 1)
661
#define __ev_get_upper_s32(a) __ev_get_s32_internal ((a), 0)
662
#define __ev_get_lower_s32(a) __ev_get_s32_internal ((a), 1)
663
#define __ev_get_upper_fs(a) __ev_get_fs_internal ((a), 0)
664
#define __ev_get_lower_fs(a) __ev_get_fs_internal ((a), 1)
665
#define __ev_get_upper_ufix32_u32 __ev_get_upper_u32
666
#define __ev_get_lower_ufix32_u32 __ev_get_lower_u32
667
#define __ev_get_upper_sfix32_s32 __ev_get_upper_s32
668
#define __ev_get_lower_sfix32_s32 __ev_get_lower_s32
669
#define __ev_get_upper_sfix32_fs(a)  __ev_get_sfix32_fs ((a), 0)
670
#define __ev_get_lower_sfix32_fs(a)  __ev_get_sfix32_fs ((a), 1)
671
#define __ev_get_upper_ufix32_fs(a)  __ev_get_ufix32_fs ((a), 0)
672
#define __ev_get_lower_ufix32_fs(a)  __ev_get_ufix32_fs ((a), 1)
673
 
674
#define __ev_get_u32 __ev_get_u32_internal
675
#define __ev_get_s32 __ev_get_s32_internal
676
#define __ev_get_fs __ev_get_fs_internal
677
#define __ev_get_u16 __ev_get_u16_internal
678
#define __ev_get_s16 __ev_get_s16_internal
679
 
680
#define __ev_get_ufix32_u32 __ev_get_u32
681
#define __ev_get_sfix32_s32 __ev_get_s32
682
#define __ev_get_ufix32_fs     __ev_get_ufix32_fs_internal
683
#define __ev_get_sfix32_fs     __ev_get_sfix32_fs_internal
684
 
685
static inline uint32_t
686
__ev_get_u32_internal (__ev64_opaque__ a, uint32_t pos)
687
{
688
  union
689
  {
690
    __ev64_opaque__ v;
691
    uint32_t i[2];
692
  } u;
693
 
694
  u.v = a;
695
  return u.i[pos];
696
}
697
 
698
static inline int32_t
699
__ev_get_s32_internal (__ev64_opaque__ a, uint32_t pos)
700
{
701
  union
702
  {
703
    __ev64_opaque__ v;
704
    int32_t i[2];
705
  } u;
706
 
707
  u.v = a;
708
  return u.i[pos];
709
}
710
 
711
static inline float
712
__ev_get_fs_internal (__ev64_opaque__ a, uint32_t pos)
713
{
714
  union
715
  {
716
    __ev64_opaque__ v;
717
    float f[2];
718
  } u;
719
 
720
  u.v = a;
721
  return u.f[pos];
722
}
723
 
724
static inline float
725
__ev_get_sfix32_fs_internal (__ev64_opaque__ a, uint32_t pos)
726
{
727
  __ev64_fs__ v;
728
 
729
  v = __builtin_spe_evfscfsf ((__v2sf) a);
730
  return __ev_get_fs_internal ((__ev64_opaque__) v, pos);
731
}
732
 
733
static inline float
734
__ev_get_ufix32_fs_internal (__ev64_opaque__ a, uint32_t pos)
735
{
736
  __ev64_fs__ v;
737
 
738
  v = __builtin_spe_evfscfuf ((__v2sf) a);
739
  return __ev_get_fs_internal ((__ev64_opaque__) v, pos);
740
}
741
 
742
static inline uint16_t
743
__ev_get_u16_internal (__ev64_opaque__ a, uint32_t pos)
744
{
745
  union
746
  {
747
    __ev64_opaque__ v;
748
    uint16_t i[4];
749
  } u;
750
 
751
  u.v = a;
752
  return u.i[pos];
753
}
754
 
755
static inline int16_t
756
__ev_get_s16_internal (__ev64_opaque__ a, uint32_t pos)
757
{
758
  union
759
  {
760
    __ev64_opaque__ v;
761
    int16_t i[4];
762
  } u;
763
 
764
  u.v = a;
765
  return u.i[pos];
766
}
767
 
768
/* __ev_set_* functions.  */
769
 
770
#define __ev_set_u32 __ev_set_u32_internal
771
#define __ev_set_s32 __ev_set_s32_internal
772
#define __ev_set_fs __ev_set_fs_internal
773
#define __ev_set_u16 __ev_set_u16_internal
774
#define __ev_set_s16 __ev_set_s16_internal
775
 
776
#define __ev_set_ufix32_u32 __ev_set_u32
777
#define __ev_set_sfix32_s32 __ev_set_s32
778
 
779
#define __ev_set_sfix32_fs  __ev_set_sfix32_fs_internal
780
#define __ev_set_ufix32_fs  __ev_set_ufix32_fs_internal
781
 
782
#define __ev_set_upper_u32(a, b) __ev_set_u32 (a, b, 0)
783
#define __ev_set_lower_u32(a, b) __ev_set_u32 (a, b, 1)
784
#define __ev_set_upper_s32(a, b) __ev_set_s32 (a, b, 0)
785
#define __ev_set_lower_s32(a, b) __ev_set_s32 (a, b, 1)
786
#define __ev_set_upper_fs(a, b) __ev_set_fs (a, b, 0)
787
#define __ev_set_lower_fs(a, b) __ev_set_fs (a, b, 1)
788
#define __ev_set_upper_ufix32_u32 __ev_set_upper_u32
789
#define __ev_set_lower_ufix32_u32 __ev_set_lower_u32
790
#define __ev_set_upper_sfix32_s32 __ev_set_upper_s32
791
#define __ev_set_lower_sfix32_s32 __ev_set_lower_s32
792
#define __ev_set_upper_sfix32_fs(a, b)  __ev_set_sfix32_fs (a, b, 0)
793
#define __ev_set_lower_sfix32_fs(a, b)  __ev_set_sfix32_fs (a, b, 1)
794
#define __ev_set_upper_ufix32_fs(a, b)  __ev_set_ufix32_fs (a, b, 0)
795
#define __ev_set_lower_ufix32_fs(a, b)  __ev_set_ufix32_fs (a, b, 1)
796
 
797
#define __ev_set_acc_vec64 __builtin_spe_evmra
798
 
799
static inline __ev64_opaque__
800
__ev_set_acc_u64 (uint64_t a)
801
{
802
  __ev64_opaque__ ev32;
803
  ev32 = __ev_create_u64 (a);
804
  __ev_mra (ev32);
805
  return ev32;
806
}
807
 
808
static inline __ev64_opaque__
809
__ev_set_acc_s64 (int64_t a)
810
{
811
  __ev64_opaque__ ev32;
812
  ev32 = __ev_create_s64 (a);
813
  __ev_mra (ev32);
814
  return ev32;
815
}
816
 
817
static inline __ev64_opaque__
818
__ev_set_u32_internal (__ev64_opaque__ a, uint32_t b, uint32_t pos)
819
{
820
  union
821
  {
822
    __ev64_opaque__ v;
823
    uint32_t i[2];
824
  } u;
825
 
826
  u.v = a;
827
  u.i[pos] = b;
828
  return u.v;
829
}
830
 
831
static inline __ev64_opaque__
832
__ev_set_s32_internal (__ev64_opaque__ a, int32_t b, uint32_t pos)
833
{
834
  union
835
  {
836
    __ev64_opaque__ v;
837
    int32_t i[2];
838
  } u;
839
 
840
  u.v = a;
841
  u.i[pos] = b;
842
  return u.v;
843
}
844
 
845
static inline __ev64_opaque__
846
__ev_set_fs_internal (__ev64_opaque__ a, float b, uint32_t pos)
847
{
848
  union
849
  {
850
    __ev64_opaque__ v;
851
    float f[2];
852
  } u;
853
 
854
  u.v = a;
855
  u.f[pos] = b;
856
  return u.v;
857
}
858
 
859
static inline __ev64_opaque__
860
__ev_set_sfix32_fs_internal (__ev64_opaque__ a, float b, uint32_t pos)
861
{
862
  __ev64_opaque__ v;
863
  float other;
864
 
865
  /* Get other half.  */
866
  other = __ev_get_fs_internal (a, pos ^ 1);
867
 
868
  /* Make an sfix32 with 'b'.  */
869
  v = __ev_create_sfix32_fs (b, b);
870
 
871
  /* Set other half to what it used to be.  */
872
  return __ev_set_fs_internal (v, other, pos ^ 1);
873
}
874
 
875
static inline __ev64_opaque__
876
__ev_set_ufix32_fs_internal (__ev64_opaque__ a, float b, uint32_t pos)
877
{
878
  __ev64_opaque__ v;
879
  float other;
880
 
881
  /* Get other half.  */
882
  other = __ev_get_fs_internal (a, pos ^ 1);
883
 
884
  /* Make an ufix32 with 'b'.  */
885
  v = __ev_create_ufix32_fs (b, b);
886
 
887
  /* Set other half to what it used to be.  */
888
  return __ev_set_fs_internal (v, other, pos ^ 1);
889
}
890
 
891
static inline __ev64_opaque__
892
__ev_set_u16_internal (__ev64_opaque__ a, uint16_t b, uint32_t pos)
893
{
894
  union
895
  {
896
    __ev64_opaque__ v;
897
    uint16_t i[4];
898
  } u;
899
 
900
  u.v = a;
901
  u.i[pos] = b;
902
  return u.v;
903
}
904
 
905
static inline __ev64_opaque__
906
__ev_set_s16_internal (__ev64_opaque__ a, int16_t b, uint32_t pos)
907
{
908
  union
909
  {
910
    __ev64_opaque__ v;
911
    int16_t i[4];
912
  } u;
913
 
914
  u.v = a;
915
  u.i[pos] = b;
916
  return u.v;
917
}
918
 
919
/* Predicates.  */
920
 
921
#define __pred_all      0
922
#define __pred_any      1
923
#define __pred_upper    2
924
#define __pred_lower    3
925
 
926
#define __ev_any_gts(a, b)              __builtin_spe_evcmpgts (__pred_any, (a), (b))
927
#define __ev_all_gts(a, b)              __builtin_spe_evcmpgts (__pred_all, (a), (b))
928
#define __ev_upper_gts(a, b)            __builtin_spe_evcmpgts (__pred_upper, (a), (b))
929
#define __ev_lower_gts(a, b)            __builtin_spe_evcmpgts (__pred_lower, (a), (b))
930
#define __ev_select_gts                 __builtin_spe_evsel_gts
931
 
932
#define __ev_any_gtu(a, b)              __builtin_spe_evcmpgtu (__pred_any, (a), (b))
933
#define __ev_all_gtu(a, b)              __builtin_spe_evcmpgtu (__pred_all, (a), (b))
934
#define __ev_upper_gtu(a, b)            __builtin_spe_evcmpgtu (__pred_upper, (a), (b))
935
#define __ev_lower_gtu(a, b)            __builtin_spe_evcmpgtu (__pred_lower, (a), (b))
936
#define __ev_select_gtu                 __builtin_spe_evsel_gtu
937
 
938
#define __ev_any_lts(a, b)              __builtin_spe_evcmplts (__pred_any, (a), (b))
939
#define __ev_all_lts(a, b)              __builtin_spe_evcmplts (__pred_all, (a), (b))
940
#define __ev_upper_lts(a, b)            __builtin_spe_evcmplts (__pred_upper, (a), (b))
941
#define __ev_lower_lts(a, b)            __builtin_spe_evcmplts (__pred_lower, (a), (b))
942
#define __ev_select_lts(a, b, c, d)     ((__v2si) __builtin_spe_evsel_lts ((a), (b), (c), (d)))
943
 
944
#define __ev_any_ltu(a, b)              __builtin_spe_evcmpltu (__pred_any, (a), (b))
945
#define __ev_all_ltu(a, b)              __builtin_spe_evcmpltu (__pred_all, (a), (b))
946
#define __ev_upper_ltu(a, b)            __builtin_spe_evcmpltu (__pred_upper, (a), (b))
947
#define __ev_lower_ltu(a, b)            __builtin_spe_evcmpltu (__pred_lower, (a), (b))
948
#define __ev_select_ltu                 __builtin_spe_evsel_ltu
949
#define __ev_any_eq(a, b)               __builtin_spe_evcmpeq (__pred_any, (a), (b))
950
#define __ev_all_eq(a, b)               __builtin_spe_evcmpeq (__pred_all, (a), (b))
951
#define __ev_upper_eq(a, b)             __builtin_spe_evcmpeq (__pred_upper, (a), (b))
952
#define __ev_lower_eq(a, b)             __builtin_spe_evcmpeq (__pred_lower, (a), (b))
953
#define __ev_select_eq                  __builtin_spe_evsel_eq
954
 
955
#define __ev_any_fs_gt(a, b)            __builtin_spe_evfscmpgt (__pred_any, (a), (b))
956
#define __ev_all_fs_gt(a, b)            __builtin_spe_evfscmpgt (__pred_all, (a), (b))
957
#define __ev_upper_fs_gt(a, b)          __builtin_spe_evfscmpgt (__pred_upper, (a), (b))
958
#define __ev_lower_fs_gt(a, b)          __builtin_spe_evfscmpgt (__pred_lower, (a), (b))
959
#define __ev_select_fs_gt               __builtin_spe_evsel_fsgt
960
 
961
#define __ev_any_fs_lt(a, b)            __builtin_spe_evfscmplt (__pred_any, (a), (b))
962
#define __ev_all_fs_lt(a, b)            __builtin_spe_evfscmplt (__pred_all, (a), (b))
963
#define __ev_upper_fs_lt(a, b)          __builtin_spe_evfscmplt (__pred_upper, (a), (b))
964
#define __ev_lower_fs_lt(a, b)          __builtin_spe_evfscmplt (__pred_lower, (a), (b))
965
#define __ev_select_fs_lt               __builtin_spe_evsel_fslt
966
 
967
#define __ev_any_fs_eq(a, b)            __builtin_spe_evfscmpeq (__pred_any, (a), (b))
968
#define __ev_all_fs_eq(a, b)            __builtin_spe_evfscmpeq (__pred_all, (a), (b))
969
#define __ev_upper_fs_eq(a, b)          __builtin_spe_evfscmpeq (__pred_upper, (a), (b))
970
#define __ev_lower_fs_eq(a, b)          __builtin_spe_evfscmpeq (__pred_lower, (a), (b))
971
#define __ev_select_fs_eq               __builtin_spe_evsel_fseq
972
 
973
#define __ev_any_fs_tst_gt(a, b)        __builtin_spe_evfststgt (__pred_any, (a), (b))
974
#define __ev_all_fs_tst_gt(a, b)        __builtin_spe_evfststgt (__pred_all, (a), (b))
975
#define __ev_upper_fs_tst_gt(a, b)      __builtin_spe_evfststgt (__pred_upper, (a), (b))
976
#define __ev_lower_fs_tst_gt(a, b)      __builtin_spe_evfststgt (__pred_lower, (a), (b))
977
#define __ev_select_fs_tst_gt           __builtin_spe_evsel_fststgt
978
 
979
#define __ev_any_fs_tst_lt(a, b)        __builtin_spe_evfststlt (__pred_any, (a), (b))
980
#define __ev_all_fs_tst_lt(a, b)        __builtin_spe_evfststlt (__pred_all, (a), (b))
981
#define __ev_upper_fs_tst_lt(a, b)      __builtin_spe_evfststlt (__pred_upper, (a), (b))
982
#define __ev_lower_fs_tst_lt(a, b)      __builtin_spe_evfststlt (__pred_lower, (a), (b))
983
#define __ev_select_fs_tst_lt           __builtin_spe_evsel_fststlt
984
 
985
#define __ev_any_fs_tst_eq(a, b)        __builtin_spe_evfststeq (__pred_any, (a), (b))
986
#define __ev_all_fs_tst_eq(a, b)        __builtin_spe_evfststeq (__pred_all, (a), (b))
987
#define __ev_upper_fs_tst_eq(a, b)      __builtin_spe_evfststeq (__pred_upper, (a), (b))
988
#define __ev_lower_fs_tst_eq(a, b)      __builtin_spe_evfststeq (__pred_lower, (a), (b))
989
#define __ev_select_fs_tst_eq           __builtin_spe_evsel_fststeq
990
 
991
/* SPEFSCR accessor functions.  */
992
 
993
#define __SPEFSCR_SOVH          0x80000000
994
#define __SPEFSCR_OVH           0x40000000
995
#define __SPEFSCR_FGH           0x20000000
996
#define __SPEFSCR_FXH           0x10000000
997
#define __SPEFSCR_FINVH         0x08000000
998
#define __SPEFSCR_FDBZH         0x04000000
999
#define __SPEFSCR_FUNFH         0x02000000
1000
#define __SPEFSCR_FOVFH         0x01000000
1001
/* 2 unused bits.  */
1002
#define __SPEFSCR_FINXS         0x00200000
1003
#define __SPEFSCR_FINVS         0x00100000
1004
#define __SPEFSCR_FDBZS         0x00080000
1005
#define __SPEFSCR_FUNFS         0x00040000
1006
#define __SPEFSCR_FOVFS         0x00020000
1007
#define __SPEFSCR_MODE          0x00010000
1008
#define __SPEFSCR_SOV           0x00008000
1009
#define __SPEFSCR_OV            0x00004000
1010
#define __SPEFSCR_FG            0x00002000
1011
#define __SPEFSCR_FX            0x00001000
1012
#define __SPEFSCR_FINV          0x00000800
1013
#define __SPEFSCR_FDBZ          0x00000400
1014
#define __SPEFSCR_FUNF          0x00000200
1015
#define __SPEFSCR_FOVF          0x00000100
1016
/* 1 unused bit.  */
1017
#define __SPEFSCR_FINXE         0x00000040
1018
#define __SPEFSCR_FINVE         0x00000020
1019
#define __SPEFSCR_FDBZE         0x00000010
1020
#define __SPEFSCR_FUNFE         0x00000008
1021
#define __SPEFSCR_FOVFE         0x00000004
1022
#define __SPEFSCR_FRMC          0x00000003
1023
 
1024
#define __ev_get_spefscr_sovh() (__builtin_spe_mfspefscr () & __SPEFSCR_SOVH)
1025
#define __ev_get_spefscr_ovh() (__builtin_spe_mfspefscr () & __SPEFSCR_OVH)
1026
#define __ev_get_spefscr_fgh() (__builtin_spe_mfspefscr () & __SPEFSCR_FGH)
1027
#define __ev_get_spefscr_fxh() (__builtin_spe_mfspefscr () & __SPEFSCR_FXH)
1028
#define __ev_get_spefscr_finvh() (__builtin_spe_mfspefscr () & __SPEFSCR_FINVH)
1029
#define __ev_get_spefscr_fdbzh() (__builtin_spe_mfspefscr () & __SPEFSCR_FDBZH)
1030
#define __ev_get_spefscr_funfh() (__builtin_spe_mfspefscr () & __SPEFSCR_FUNFH)
1031
#define __ev_get_spefscr_fovfh() (__builtin_spe_mfspefscr () & __SPEFSCR_FOVFH)
1032
#define __ev_get_spefscr_finxs() (__builtin_spe_mfspefscr () & __SPEFSCR_FINXS)
1033
#define __ev_get_spefscr_finvs() (__builtin_spe_mfspefscr () & __SPEFSCR_FINVS)
1034
#define __ev_get_spefscr_fdbzs() (__builtin_spe_mfspefscr () & __SPEFSCR_FDBZS)
1035
#define __ev_get_spefscr_funfs() (__builtin_spe_mfspefscr () & __SPEFSCR_FUNFS)
1036
#define __ev_get_spefscr_fovfs() (__builtin_spe_mfspefscr () & __SPEFSCR_FOVFS)
1037
#define __ev_get_spefscr_mode() (__builtin_spe_mfspefscr () & __SPEFSCR_MODE)
1038
#define __ev_get_spefscr_sov() (__builtin_spe_mfspefscr () & __SPEFSCR_SOV)
1039
#define __ev_get_spefscr_ov() (__builtin_spe_mfspefscr () & __SPEFSCR_OV)
1040
#define __ev_get_spefscr_fg() (__builtin_spe_mfspefscr () & __SPEFSCR_FG)
1041
#define __ev_get_spefscr_fx() (__builtin_spe_mfspefscr () & __SPEFSCR_FX)
1042
#define __ev_get_spefscr_finv() (__builtin_spe_mfspefscr () & __SPEFSCR_FINV)
1043
#define __ev_get_spefscr_fdbz() (__builtin_spe_mfspefscr () & __SPEFSCR_FDBZ)
1044
#define __ev_get_spefscr_funf() (__builtin_spe_mfspefscr () & __SPEFSCR_FUNF)
1045
#define __ev_get_spefscr_fovf() (__builtin_spe_mfspefscr () & __SPEFSCR_FOVF)
1046
#define __ev_get_spefscr_finxe() (__builtin_spe_mfspefscr () & __SPEFSCR_FINXE)
1047
#define __ev_get_spefscr_finve() (__builtin_spe_mfspefscr () & __SPEFSCR_FINVE)
1048
#define __ev_get_spefscr_fdbze() (__builtin_spe_mfspefscr () & __SPEFSCR_FDBZE)
1049
#define __ev_get_spefscr_funfe() (__builtin_spe_mfspefscr () & __SPEFSCR_FUNFE)
1050
#define __ev_get_spefscr_fovfe() (__builtin_spe_mfspefscr () & __SPEFSCR_FOVFE)
1051
#define __ev_get_spefscr_frmc() (__builtin_spe_mfspefscr () & __SPEFSCR_FRMC)
1052
 
1053
static inline void
1054
__ev_clr_spefscr_field (int mask)
1055
{
1056
  int i;
1057
 
1058
  i = __builtin_spe_mfspefscr ();
1059
  i &= ~mask;
1060
  __builtin_spe_mtspefscr (i);
1061
}
1062
 
1063
#define __ev_clr_spefscr_sovh() __ev_clr_spefscr_field (__SPEFSCR_SOVH)
1064
#define __ev_clr_spefscr_sov() __ev_clr_spefscr_field (__SPEFSCR_SOV)
1065
#define __ev_clr_spefscr_finxs() __ev_clr_spefscr_field (__SPEFSCR_FINXS)
1066
#define __ev_clr_spefscr_finvs() __ev_clr_spefscr_field (__SPEFSCR_FINVS)
1067
#define __ev_clr_spefscr_fdbzs() __ev_clr_spefscr_field (__SPEFSCR_FDBZS)
1068
#define __ev_clr_spefscr_funfs() __ev_clr_spefscr_field (__SPEFSCR_FUNFS)
1069
#define __ev_clr_spefscr_fovfs() __ev_clr_spefscr_field (__SPEFSCR_FOVFS)
1070
 
1071
/* Set rounding mode:
1072
     rnd = 0 (nearest)
1073
     rnd = 1 (zero)
1074
     rnd = 2 (+inf)
1075
     rnd = 3 (-inf).  */
1076
 
1077
static inline void
1078
__ev_set_spefscr_frmc (int rnd)
1079
{
1080
  int i;
1081
 
1082
  i = __builtin_spe_mfspefscr ();
1083
  i &= ~__SPEFSCR_FRMC;
1084
  i |= rnd;
1085
  __builtin_spe_mtspefscr (i);
1086
}
1087
 
1088
/* The SPE PIM says these are declared in <spe.h>, although they are
1089
   not provided by GCC: they must be taken from a separate
1090
   library.  */
1091
extern short int atosfix16 (const char *);
1092
extern int atosfix32 (const char *);
1093
extern long long atosfix64 (const char *);
1094
 
1095
extern unsigned short atoufix16 (const char *);
1096
extern unsigned int atoufix32 (const char *);
1097
extern unsigned long long atoufix64 (const char *);
1098
 
1099
extern short int strtosfix16 (const char *, char **);
1100
extern int strtosfix32 (const char *, char **);
1101
extern long long strtosfix64 (const char *, char **);
1102
 
1103
extern unsigned short int strtoufix16 (const char *, char **);
1104
extern unsigned int strtoufix32 (const char *, char **);
1105
extern unsigned long long strtoufix64 (const char *, char **);
1106
 
1107
#endif /* _SPE_H */

powered by: WebSVN 2.1.0

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