/
rosesimd.c
746 lines (680 loc) · 14 KB
/
rosesimd.c
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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
/*
Author: Pei-Hung Lin
Contact: lin32@llnl.gov, phlin@cs.umn.edu
Date Created : July 26th, 2012
This file provides runtime library functions.
The functions will map to the SIMD intrinsic functions used in different compilers.
*/
//#include "rose_config.h"
#include "rose_simd.h"
#define USE_SSE 1
/*
V_SgAddOp
*/
__SIMD _SIMD_add_ps(__SIMD a, __SIMD b)
{
#ifdef USE_SSE
return _mm_add_ps(a,b);
#elif defined USE_AVX
return _m256_add_ps(a,b);
#elif defined USE_IBM
return vec_add(a,b);
#endif
}
__SIMDd _SIMD_add_pd(__SIMDd a, __SIMDd b)
{
#ifdef USE_SSE
return _mm_add_pd(a,b);
#elif defined USE_AVX
return _m256_add_ps(a,b);
#elif defined USE_IBM
return vec_add(a,b);
#endif
}
__SIMDi _SIMD_add_epi32(__SIMDi a, __SIMDi b)
{
#ifdef USE_SSE
return _mm_add_epi32(a,b);
#elif defined USE_AVX
return _m256_add_ps(a,b);
#elif defined USE_IBM
return vec_add(a,b);
#endif
}
/*
V_SgSubtractOp
*/
__SIMD _SIMD_sub_ps(__SIMD a, __SIMD b)
{
#ifdef USE_SSE
return _mm_sub_ps(a,b);
#elif defined USE_AVX
return _m256_sub_ps(a,b);
#elif defined USE_IBM
return vec_sub(a,b);
#endif
}
__SIMDd _SIMD_sub_pd(__SIMDd a, __SIMDd b)
{
#ifdef USE_SSE
return _mm_sub_pd(a,b);
#elif defined USE_AVX
return _m256_sub_ps(a,b);
#elif defined USE_IBM
return vec_sub(a,b);
#endif
}
__SIMDi _SIMD_sub_epi32(__SIMDi a, __SIMDi b)
{
#ifdef USE_SSE
return _mm_sub_epi32(a,b);
#elif defined USE_AVX
return _m256_sub_ps(a,b);
#elif defined USE_IBM
return vec_sub(a,b);
#endif
}
/*
V_SgMultiplyOp
*/
__SIMD _SIMD_mul_ps(__SIMD a, __SIMD b)
{
#ifdef USE_SSE
return _mm_mul_ps(a,b);
#elif defined USE_AVX
return _m256_mul_ps(a,b);
#elif defined USE_IBM
return vec_mul(a,b);
#endif
}
__SIMDd _SIMD_mul_pd(__SIMDd a, __SIMDd b)
{
#ifdef USE_SSE
return _mm_mul_pd(a,b);
#elif defined USE_AVX
return _m256_mul_ps(a,b);
#elif defined USE_IBM
return vec_mul(a,b);
#endif
}
__SIMDi _SIMD_mul_epi32(__SIMDi a, __SIMDi b)
{
#ifdef USE_SSE
__m128i tmp1 = _mm_mul_epu32(a,b); /* mul 2,0*/
__m128i tmp2 = _mm_mul_epu32( _mm_srli_si128(a,4), _mm_srli_si128(b,4)); /* mul 3,1 */
return _mm_unpacklo_epi32(_mm_shuffle_epi32(tmp1, _MM_SHUFFLE (0,0,2,0)), _mm_shuffle_epi32(tmp2, _MM_SHUFFLE (0,0,2,0))); /* shuffle results to [63..0] and pack */
#elif defined USE_AVX
return _m256_mul_ps(a,b);
#elif defined USE_IBM
return vec_mul(a,b);
#endif
}
/*
V_SgDivideOp
*/
__SIMD _SIMD_div_ps(__SIMD a, __SIMD b)
{
#ifdef USE_SSE
return _mm_div_ps(a,b);
#elif defined USE_AVX
return _m256_div_ps(a,b);
#elif defined USE_IBM
return vec_div(a,b);
#endif
}
__SIMDd _SIMD_div_pd(__SIMDd a, __SIMDd b)
{
#ifdef USE_SSE
return _mm_div_pd(a,b);
#elif defined USE_AVX
return _m256_div_ps(a,b);
#elif defined USE_IBM
return vec_div(a,b);
#endif
}
/*
__SIMDi _SIMD_div_epi32(__SIMDi a, __SIMDi b)
{
#ifdef USE_SSE
return _mm_div_epi32(a,b);
#elif defined USE_AVX
return _m256_div_ps(a,b);
#elif defined USE_IBM
return vec_div(a,b);
#endif
}
*/
/*
multiply-add
*/
__SIMD _SIMD_madd_ps(__SIMD a, __SIMD b, __SIMD c)
{
#ifdef USE_SSE
return _mm_add_ps(_mm_mul_ps(a,b),c);
#elif defined USE_AVX
return _m256_madd_ps(a,b);
#elif defined USE_IBM
return vec_madd(a,b);
#endif
}
__SIMDd _SIMD_madd_pd(__SIMDd a, __SIMDd b, __SIMDd c)
{
#ifdef USE_SSE
return _mm_add_pd(_mm_mul_pd(a,b),c);
#elif defined USE_AVX
return _m256_madd_ps(a,b);
#elif defined USE_IBM
return vec_madd(a,b);
#endif
}
__SIMDi _SIMD_madd_epi32(__SIMDi a, __SIMDi b, __SIMDi c)
{
#ifdef USE_SSE
return _SIMD_add_epi32(_SIMD_mul_epi32(a,b),c);
#elif defined USE_AVX
return _m256_madd_ps(a,b);
#elif defined USE_IBM
return vec_madd(a,b);
#endif
}
/*
multiply-subtract
*/
__SIMD _SIMD_msub_ps(__SIMD a, __SIMD b, __SIMD c)
{
#ifdef USE_SSE
return _mm_sub_ps(_mm_mul_ps(a,b),c);
#elif defined USE_AVX
return _m256_msub_ps(a,b);
#elif defined USE_IBM
return vec_msub(a,b);
#endif
}
__SIMDd _SIMD_msub_pd(__SIMDd a, __SIMDd b, __SIMDd c)
{
#ifdef USE_SSE
return _mm_sub_pd(_mm_mul_pd(a,b),c);
#elif defined USE_AVX
return _m256_msub_ps(a,b);
#elif defined USE_IBM
return vec_msub(a,b);
#endif
}
__SIMDi _SIMD_msub_epi32(__SIMDi a, __SIMDi b, __SIMDi c)
{
#ifdef USE_SSE
return _SIMD_sub_epi32(_SIMD_mul_epi32(a,b),c);
#elif defined USE_AVX
return _m256_msub_ps(a,b);
#elif defined USE_IBM
return vec_msub(a,b);
#endif
}
/*
_SIMD_splats_(ARG1)
Returns a vector of which the value of each element is set to ARG1.
*/
__SIMD _SIMD_splats_ps(float f)
{
#ifdef USE_SSE
return _mm_set1_ps(f);
#elif defined USE_AVX
return _m256_set1_ps(f);
#elif defined USE_IBM
return vec_splats(f);
#endif
}
__SIMDd _SIMD_splats_pd(double f)
{
#ifdef USE_SSE
return _mm_set1_pd(f);
#elif defined USE_AVX
return _m256_set1_pd(f);
#elif defined USE_IBM
return vec_splats(f);
#endif
}
__SIMDi _SIMD_splats_epi32(int32_t i)
{
#ifdef USE_SSE
return _mm_set1_epi32(i);
#elif defined USE_AVX
return _m256_set1_epi32(i);
#elif defined USE_IBM
return vec_splats(i);
#endif
}
/*
V_SgAndOp
int32_teger is not supported.
*/
__SIMD _SIMD_and_ps(__SIMD a, __SIMD b)
{
#ifdef USE_SSE
return _mm_and_ps(a,b);
#elif defined USE_AVX
return _m256_and_ps(a,b);
#elif defined USE_IBM
return vec_and(a,b);
#endif
}
__SIMDd _SIMD_and_pd(__SIMDd a, __SIMDd b)
{
#ifdef USE_SSE
return _mm_and_pd(a,b);
#elif defined USE_AVX
return _m256_and_ps(a,b);
#elif defined USE_IBM
return vec_and(a,b);
#endif
}
/*
V_SgBitOrOp
int32_teger is not supported.
*/
__SIMD _SIMD_or_ps(__SIMD a, __SIMD b)
{
#ifdef USE_SSE
return _mm_or_ps(a,b);
#elif defined USE_AVX
return _m256_or_ps(a,b);
#elif defined USE_IBM
return vec_or(a,b);
#endif
}
__SIMDd _SIMD_or_pd(__SIMDd a, __SIMDd b)
{
#ifdef USE_SSE
return _mm_or_pd(a,b);
#elif defined USE_AVX
return _m256_or_ps(a,b);
#elif defined USE_IBM
return vec_or(a,b);
#endif
}
/*
V_SgBitXorOp
integer is not supported.
todo: need to verify the support for double-precision
*/
__SIMD _SIMD_xor_ps(__SIMD a, __SIMD b)
{
#ifdef USE_SSE
return _mm_xor_ps(a,b);
#elif defined USE_AVX
return _m256_xor_ps(a,b);
#elif defined USE_IBM
return vec_xor(a,b);
#endif
}
__SIMDd _SIMD_xor_pd(__SIMDd a, __SIMDd b)
{
#ifdef USE_SSE
return _mm_xor_pd(a,b);
#elif defined USE_AVX
return _m256_xor_ps(a,b);
#elif defined USE_IBM
return vec_xor(a,b);
#endif
}
/*
V_SgMinusOp
*/
__SIMD _SIMD_neg_ps(__SIMD a)
{
#ifdef USE_SSE
return _mm_xor_ps(a, _mm_set1_ps(-0.0f));
#elif defined USE_AVX
return _mm256_xor_ps(a, _mm_set1_ps(-0.0f));
#elif defined USE_IBM
return vec_neg(a);
#endif
}
__SIMDd _SIMD_neg_pd(__SIMDd a)
{
#ifdef USE_SSE
return _mm_xor_pd(a, _mm_set1_pd(-0.0f));
#elif defined USE_AVX
return _mm256_xor_pd(a, _mm_set1_pd(-0.0f));
#elif defined USE_IBM
return vec_neg(a);
#endif
}
/*
SIMD selection
*/
__SIMD _SIMD_sel_ps(__SIMD a, __SIMD b, void** resultPtr)
{
#ifdef USE_SSE
__SIMD* result = (__SIMD*) (*resultPtr);
return _mm_or_ps(_mm_andnot_ps(*result,a),_mm_and_ps(*result,b));
#elif defined USE_AVX
__SIMD* result = (__SIMD*) resultPtr;
return _mm256_or_ps(_mm256_andnot_ps(*result,a),_mm256_and_ps(*result,b));
#elif defined USE_IBM
return vec_sel(a,b,c);
#endif
}
__SIMDd _SIMD_sel_pd(__SIMDd a, __SIMDd b, void** resultPtr)
{
#ifdef USE_SSE
__SIMDd* result = (__SIMDd*) (*resultPtr);
return _mm_or_pd(_mm_andnot_pd(*result,a),_mm_and_pd(*result,b));
#elif defined USE_AVX
__SIMDd* result = (__SIMDd*) resultPtr;
return _mm256_or_pd(_mm256_andnot_pd(*result,a),_mm256_and_pd(*result,b));
#elif defined USE_IBM
return vec_sel(a,b,c);
#endif
}
/*
SIMD comparison: void _SIMD_cmp_eq(a,b,c)
a and b are the arguements for comparison. c will be the return result.
*/
// a == b
void _SIMD_cmpeq_ps(__SIMD a, __SIMD b, void** resultPtr)
{
__SIMD* result = (__SIMD*)malloc(sizeof(__SIMD));
*resultPtr = result;
#ifdef USE_SSE
*result = _mm_cmpeq_ps(a,b);
#elif defined USE_AVX
*result = _mm256_cmp_ps(a,b,0);
#elif defined USE_IBM
*result = vec_cmpeq(a,b);
#endif
}
void _SIMD_cmpeq_pd(__SIMDd a, __SIMDd b, void** resultPtr)
{
__SIMDd* result = (__SIMDd*)malloc(sizeof(__SIMDd));
*resultPtr = result;
#ifdef USE_SSE
*result = _mm_cmpeq_pd(a,b);
#elif defined USE_AVX
*result = _mm256_cmp(a,b,0);
#elif defined USE_IBM
*result = vec_cmpeq(a,b);
#endif
}
// a != b
void _SIMD_cmpne_ps(__SIMD a, __SIMD b, void** resultPtr)
{
__SIMD* result = (__SIMD*)malloc(sizeof(__SIMD));
*resultPtr = result;
#ifdef USE_SSE
*result = _mm_cmpneq_ps(a,b);
#elif defined USE_AVX
*result = _mm256_cmp_ps(a,b,4);
#elif defined USE_IBM
*result = vec_xor(vec_cmpeq(a,b));
#endif
}
void _SIMD_cmpne_pd(__SIMDd a, __SIMDd b, void** resultPtr)
{
__SIMDd* result = (__SIMDd*)malloc(sizeof(__SIMDd));
*resultPtr = result;
#ifdef USE_SSE
*result = _mm_cmpneq_pd(a,b);
#elif defined USE_AVX
*result = _mm256_cmpneq_pd(a,b,4);
#elif defined USE_IBM
*result = vec_xor(vec_cmpeq(a,b));
#endif
}
// a < b
void _SIMD_cmplt_ps(__SIMD a, __SIMD b, void** resultPtr)
{
__SIMD* result = (__SIMD*)malloc(sizeof(__SIMD));
*resultPtr = result;
#ifdef USE_SSE
*result = _mm_cmplt_ps(a,b);
#elif defined USE_AVX
*result = _mm256_cmp_ps(a,b,17);
#elif defined USE_IBM
*result = vec_cmplt(a,b);
#endif
}
void _SIMD_cmplt_pd(__SIMDd a, __SIMDd b, void** resultPtr)
{
__SIMDd* result = (__SIMDd*)malloc(sizeof(__SIMDd));
*resultPtr = result;
#ifdef USE_SSE
*result = _mm_cmplt_pd(a,b);
#elif defined USE_AVX
*result = _mm256_cmp(a,b,17);
#elif defined USE_IBM
*result = vec_cmplt(a,b);
#endif
}
// a <= b
void _SIMD_cmple_ps(__SIMD a, __SIMD b, void** resultPtr)
{
__SIMD* result = (__SIMD*)malloc(sizeof(__SIMD));
*resultPtr = result;
#ifdef USE_SSE
*result = _mm_cmple_ps(a,b);
#elif defined USE_AVX
*result = _mm256_cmp_ps(a,b,18);
#elif defined USE_IBM
*result = vec_cmple(a,b);
#endif
}
void _SIMD_cmple_pd(__SIMDd a, __SIMDd b, void** resultPtr)
{
__SIMDd* result = (__SIMDd*)malloc(sizeof(__SIMDd));
*resultPtr = result;
#ifdef USE_SSE
*result = _mm_cmple_pd(a,b);
#elif defined USE_AVX
*result = _mm256_cmp(a,b,18);
#elif defined USE_IBM
*result = vec_cmple(a,b);
#endif
}
// a > b
void _SIMD_cmpgt_ps(__SIMD a, __SIMD b, void** resultPtr)
{
__SIMD* result = (__SIMD*)malloc(sizeof(__SIMD));
*resultPtr = result;
#ifdef USE_SSE
*result = _mm_cmpgt_ps(a,b);
#elif defined USE_AVX
*result = _mm256_cmp_ps(a,b,30);
#elif defined USE_IBM
*result = vec_cmpgt(a,b);
#endif
}
void _SIMD_cmpgt_pd(__SIMDd a, __SIMDd b, void** resultPtr)
{
__SIMDd* result = (__SIMDd*)malloc(sizeof(__SIMDd));
*resultPtr = result;
#ifdef USE_SSE
*result = _mm_cmple_pd(a,b);
#elif defined USE_AVX
*result = _mm256_cmp(a,b,30);
#elif defined USE_IBM
*result = vec_cmpgt(a,b);
#endif
}
// a >= b
void _SIMD_cmpge_ps(__SIMD a, __SIMD b, void** resultPtr)
{
__SIMD* result = (__SIMD*)malloc(sizeof(__SIMD));
*resultPtr = result;
#ifdef USE_SSE
*result = _mm_cmpge_ps(a,b);
#elif defined USE_AVX
*result = _mm256_cmp_ps(a,b,29);
#elif defined USE_IBM
*result = vec_cmpge(a,b);
#endif
}
void _SIMD_cmpge_pd(__SIMDd a, __SIMDd b, void** resultPtr)
{
__SIMDd* result = (__SIMDd*)malloc(sizeof(__SIMDd));
*resultPtr = result;
#ifdef USE_SSE
*result = _mm_cmpge_pd(a,b);
#elif defined USE_AVX
*result = _mm256_cmp(a,b,29);
#elif defined USE_IBM
*result = vec_cmpge(a,b);
#endif
}
// extract scalar from SIMD operand
float _SIMD_extract_ps(__SIMD a, int32_t i)
{
#if defined USE_IBM
return vec_extract(a,i);
#else
return *(((float*)&a)+i);
#endif
}
double _SIMD_extract_pd(__SIMDd a, int32_t i)
{
#if defined USE_IBM
return vec_extract(a,i);
#else
return *(((double*)&a)+i);
#endif
}
int32_t _SIMD_extract_epi32(__SIMDi a, int32_t i)
{
#if defined USE_IBM
return vec_extract(a,i);
#else
return *(((int32_t*)&a)+i);
#endif
}
/*
Sqrt
*/
__SIMD _SIMD_sqrt_ps(__SIMD a)
{
#ifdef USE_SSE
return _mm_sqrt_ps(a);
#elif defined USE_AVX
return _mm256_sqrt_ps(a);
#elif defined USE_IBM
return vec_sqrt(a);
#endif
}
__SIMDd _SIMD_sqrt_pd(__SIMDd a)
{
#ifdef USE_SSE
return _mm_sqrt_pd(a);
#elif defined USE_AVX
return _mm256_sqrt_pd(a);
#elif defined USE_IBM
return vec_sqrt(a);
#endif
}
// SIMD abs
__SIMD _SIMD_abs_ps(__SIMD a)
{
#ifdef USE_SSE
return _mm_andnot_ps(_mm_set1_ps(-0.0f), a);
#elif defined USE_AVX
return _mm256_andnot_ps(_mm256_set1_ps(-0.0f), a);
#elif defined USE_IBM
return vec_abs(a);
#endif
}
__SIMDd _SIMD_abs_pd(__SIMDd a)
{
#ifdef USE_SSE
return _mm_andnot_pd(_mm_set1_pd(-0.0f), a);
#elif defined USE_AVX
return _mm256_andnot_pd(_mm256_set1_pd(-0.0f), a);
#elif defined USE_IBM
return vec_abs(a);
#endif
}
__SIMDi _SIMD_abs_epi32(__SIMDi a)
{
#ifdef USE_SSE
return _mm_andnot_si128(_mm_set1_epi32(-0), a);
#elif defined USE_AVX
return _mm256_andnot_si256(_mm256_set1_epi32(-0), a);
#elif defined USE_IBM
return vec_abs(a);
#endif
}
// SIMD max
__SIMD _SIMD_max_ps(__SIMD a, __SIMD b)
{
#ifdef USE_SSE
return _mm_max_ps(a,b);
#elif defined USE_AVX
return _mm256_max_ps(a,b);
#elif defined USE_IBM
return vec_max(a,b);
#endif
}
__SIMDd _SIMD_max_pd(__SIMDd a, __SIMDd b)
{
#ifdef USE_SSE
return _mm_max_pd(a,b);
#elif defined USE_AVX
return _mm256_max_pd(a,b);
#elif defined USE_IBM
return vec_max(a,b);
#endif
}
// SIMD min
__SIMD _SIMD_min_ps(__SIMD a, __SIMD b)
{
#ifdef USE_SSE
return _mm_min_ps(a,b);
#elif defined USE_AVX
return _mm256_min_ps(a,b);
#elif defined USE_IBM
return vec_min(a,b);
#endif
}
__SIMDd _SIMD_min_pd(__SIMDd a, __SIMDd b)
{
#ifdef USE_SSE
return _mm_min_pd(a,b);
#elif defined USE_AVX
return _mm256_min_pd(a,b);
#elif defined USE_IBM
return vec_min(a,b);
#endif
}
// SIMD sin
__SIMD _SIMD_sin_ps(__SIMD a)
{
#ifdef USE_SSE
return sin_ps(a);
#elif defined USE_AVX
return sin256_ps(a);
#endif
}
// SIMD cos
__SIMD _SIMD_cos_ps(__SIMD a)
{
#ifdef USE_SSE
return cos_ps(a);
#elif defined USE_AVX
return cos256_ps(a);
#endif
}
// SIMD log
__SIMD _SIMD_log_ps(__SIMD a)
{
#ifdef USE_SSE
return log_ps(a);
#elif defined USE_AVX
return log256_ps(a);
#endif
}
// SIMD exp
__SIMD _SIMD_exp_ps(__SIMD a)
{
#ifdef USE_SSE
return exp_ps(a);
#elif defined USE_AVX
return exp256_ps(a);
#endif
}