| 1 |
/* PR target/101611 */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-O2 -mavx2 -mno-avx512f" } */ |
| 4 |
/* { dg-require-effective-target avx2 } */ |
| 5 |
|
| 6 |
#include "avx2-check.h" |
| 7 |
|
| 8 |
typedef long long V __attribute__((vector_size(32))); |
| 9 |
typedef long long W __attribute__((vector_size(16))); |
| 10 |
|
| 11 |
__attribute__((noipa)) V |
| 12 |
foo (V a, V b) |
| 13 |
{ |
| 14 |
return a >> b; |
| 15 |
} |
| 16 |
|
| 17 |
__attribute__((noipa)) W |
| 18 |
bar (W a, W b) |
| 19 |
{ |
| 20 |
return a >> b; |
| 21 |
} |
| 22 |
|
| 23 |
static void |
| 24 |
avx2_test (void) |
| 25 |
{ |
| 26 |
V a = { 0x7f123456789abcdeLL, -0x30edcba987654322LL, |
| 27 |
-0x30edcba987654322LL, 0x7f123456789abcdeLL }; |
| 28 |
V b = { 17, 11, 23, 0 }; |
| 29 |
V c = foo (a, b); |
| 30 |
if (c[0] != 0x3f891a2b3c4dLL |
| 31 |
|| c[1] != -0x61db97530eca9LL |
| 32 |
|| c[2] != -0x61db97530fLL |
| 33 |
|| c[3] != 0x7f123456789abcdeLL) |
| 34 |
abort (); |
| 35 |
W d = { 0x7f123456789abcdeLL, -0x30edcba987654322LL }; |
| 36 |
W e = { 45, 27 }; |
| 37 |
W f = bar (d, e); |
| 38 |
if (f[0] != 0x3f891LL |
| 39 |
|| f[1] != -0x61db97531LL) |
| 40 |
abort (); |
| 41 |
} |