PR target/80969 - Fix ICE with -mabi=ms -mavx512f, reduce wasted space when realignin...
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512f-vpsravq512-2.c
blobc2511e9f5ba54435f176ea30dc802adfa249b030
1 /* { dg-do run } */
2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
5 #include <string.h>
6 #include "avx512f-check.h"
8 static void
9 compute_psravq512 (long long int *s1, long long int *s2, long long int *r)
11 int i;
12 long long int count;
14 for (i = 0; i < 8; ++i)
16 count = s2[i];
17 r[i] = s1[i] >> count;
21 void static
22 avx512f_test (void)
24 union512i_q s1, s2, res;
25 long long int res_ref[8];
26 int i, j, sign = 1;
27 int fail = 0;
29 for (i = 0; i < 10; i++)
31 for (j = 0; j < 8; j++)
33 s1.a[j] = j * i * sign;
34 s2.a[j] = (j + i) >> 2;
35 sign = -sign;
38 res.x = _mm512_srav_epi64 (s1.x, s2.x);
40 compute_psravq512 (s1.a, s2.a, res_ref);
42 fail += check_union512i_q (res, res_ref);
45 if (fail != 0)
46 abort ();