LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-over-widen-1.c
blob3140829c73d1704923b522dab35007fa5f1b8c18
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_shift } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #if VECTOR_BITS > 128
8 #define N (VECTOR_BITS * 8 / 16)
9 #else
10 #define N 64
11 #endif
13 /* Modified rgb to rgb conversion from FFmpeg. */
14 __attribute__ ((noinline)) void
15 foo (unsigned char *src, unsigned char *dst)
17 unsigned char *s = src;
18 unsigned short *d = (unsigned short *)dst;
19 int i;
21 for (i = 0; i < N/4; i++)
23 const int b = *s++;
24 const int g = *s++;
25 const int r = *s++;
26 const int a = *s++;
27 *d = ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5));
28 d++;
31 s = src;
32 d = (unsigned short *)dst;
33 for (i = 0; i < N/4; i++)
35 const int b = *s++;
36 const int g = *s++;
37 const int r = *s++;
38 const int a = *s++;
39 if (*d != ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5)))
40 abort ();
41 d++;
45 int main (void)
47 int i;
48 unsigned char in[N], out[N];
50 check_vect ();
52 for (i = 0; i < N; i++)
54 in[i] = i;
55 out[i] = 255;
56 __asm__ volatile ("");
59 foo (in, out);
61 return 0;
64 /* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 2 "vect" { target vect_widen_shift } } } */
65 /* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 2 "vect" { target vect_widen_shift } } } */
66 /* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" { target { { ! vect_sizes_32B_16B } && { ! vect_widen_shift } } } } } */
67 /* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 8 "vect" { target vect_sizes_32B_16B } } } */
68 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */