comparison gcc/testsuite/gcc.target/i386/avx2-pr94460.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
145:1830386684a0 152:2b5abeee2509
1 /* PR target/94460 */
2 /* { dg-do run { target { avx2 && int128 } } } */
3 /* { dg-options "-O2 -mavx2" } */
4
5 #include <x86intrin.h>
6 #include "avx2-check.h"
7
8 typedef __int128 v2ti __attribute__ ((__vector_size__ (32)));
9
10 static inline v2ti
11 foo (__v16hi b)
12 {
13 return (v2ti) _mm256_hsub_epi16 ((__m256i) b, (__m256i) b);
14 }
15
16 static inline v2ti
17 bar (__v8si b)
18 {
19 return (v2ti) _mm256_hsub_epi32 ((__m256i) b, (__m256i) b);
20 }
21
22 static void
23 avx2_test (void)
24 {
25 v2ti x = foo ((__v16hi) { 1 });
26 if (x[0] != ((__int128)1 << 64 | 1) || x[1] != 0)
27 abort ();
28 x = bar ((__v8si) { 1 });
29 if (x[0] != ((__int128)1 << 64 | 1) || x[1] != 0)
30 abort ();
31 }