Mercurial > hg > CbC > CbC_gcc
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/gcc.target/i386/avx2-pr94460.c Mon May 25 07:50:57 2020 +0900 @@ -0,0 +1,31 @@ +/* PR target/94460 */ +/* { dg-do run { target { avx2 && int128 } } } */ +/* { dg-options "-O2 -mavx2" } */ + +#include <x86intrin.h> +#include "avx2-check.h" + +typedef __int128 v2ti __attribute__ ((__vector_size__ (32))); + +static inline v2ti +foo (__v16hi b) +{ + return (v2ti) _mm256_hsub_epi16 ((__m256i) b, (__m256i) b); +} + +static inline v2ti +bar (__v8si b) +{ + return (v2ti) _mm256_hsub_epi32 ((__m256i) b, (__m256i) b); +} + +static void +avx2_test (void) +{ + v2ti x = foo ((__v16hi) { 1 }); + if (x[0] != ((__int128)1 << 64 | 1) || x[1] != 0) + abort (); + x = bar ((__v8si) { 1 }); + if (x[0] != ((__int128)1 << 64 | 1) || x[1] != 0) + abort (); +}