2 /* { dg-options "-mavx2 -O2" } */
3 /* { dg-require-effective-target avx2 } */
5 #include "avx2-check.h"
6 #include "ssse3-vals.h"
9 compute_phaddd256 (int *i1
, int *i2
, int *r
)
13 for (i
= 0; i
< 2; i
++)
14 r
[i
+ 0] = i1
[2 * i
] + i1
[2 * i
+ 1];
16 for (i
= 0; i
< 2; i
++)
17 r
[i
+ 2] = i2
[2 * i
] + i2
[2 * i
+ 1];
19 for (i
= 0; i
< 2; i
++)
20 r
[i
+ 4] = i1
[2 * i
+ 4] + i1
[2 * i
+ 5];
22 for (i
= 0; i
< 2; i
++)
23 r
[i
+ 6] = i2
[2 * i
+ 4] + i2
[2 * i
+ 5];
29 union256i_d s1
, s2
, res
;
35 for (i
= 0; i
< 256; i
+= 16)
37 s1
.x
= _mm256_loadu_si256 ((__m256i
*) & vals
[i
]);
38 s2
.x
= _mm256_loadu_si256 ((__m256i
*) & vals
[i
+ 8]);
40 res
.x
= _mm256_hadd_epi32 (s1
.x
, s2
.x
);
42 compute_phaddd256 (s1
.a
, s2
.a
, res_ref
);
44 fail
+= check_union256i_d (res
, res_ref
);