PR target/80969 - Fix ICE with -mabi=ms -mavx512f, reduce wasted space when realignin...
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx2-vpbroadcastq128-2.c
blobe6446de7da9b5bd70ee3d19499967f7ffc67c110
1 /* { dg-do run } */
2 /* { dg-options "-mavx2 -O2" } */
3 /* { dg-require-effective-target avx2 } */
5 #include "avx2-check.h"
6 #include <string.h>
8 #define NUM 10
10 static void
11 init_pbroadcastq128 (long long int *src, int seed)
13 int i, sign = 1;
15 for (i = 0; i < 2; i++)
17 src[i] = (i + seed) * (i + seed) * sign;
18 sign = -sign;
22 static void
23 calc_pbroadcastq128 (long long int *src, long long int *dst)
25 int i;
27 for (i = 0; i < 2; i++)
28 dst[i] = src[0];
31 static void
32 avx2_test (void)
34 union128i_q src, dst;
35 long long int dst_ref[2];
36 int i;
38 for (i = 0; i < NUM; i++)
40 init_pbroadcastq128 (src.a, i);
42 dst.x = _mm_broadcastq_epi64 (src.x);
43 calc_pbroadcastq128 (src.a, dst_ref);
45 if (check_union128i_q (dst, dst_ref))
46 abort ();