1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fdump-tree-optimized" } */
9 #define SIGNEDNESS unsigned
15 void __attribute__ ((noipa
))
16 f (SIGNEDNESS
char *restrict a
, SIGNEDNESS
char *restrict b
,
17 SIGNEDNESS
char *restrict c
)
19 for (__INTPTR_TYPE__ i
= 0; i
< N
; ++i
)
21 int tmp1
= b
[i
] + BIAS
;
22 int tmp2
= tmp1
+ c
[i
];
27 #define BASE1 ((SIGNEDNESS int) -1 < 0 ? -126 : 4)
28 #define BASE2 ((SIGNEDNESS int) -1 < 0 ? -101 : 26)
35 SIGNEDNESS
char a
[N
], b
[N
], c
[N
];
36 for (int i
= 0; i
< N
; ++i
)
40 asm volatile ("" ::: "memory");
44 for (int i
= 0; i
< N
; ++i
)
45 if (a
[i
] != ((BASE1
+ BASE2
+ i
* 9 + BIAS
) >> 1))
50 /* { dg-final { scan-tree-dump "vect_recog_average_pattern: detected" "vect" } } */
51 /* { dg-final { scan-tree-dump {\.AVG_FLOOR} "vect" { target vect_avg_qi } } } */
52 /* { dg-final { scan-tree-dump-not {vector\([^\n]*short} "optimized" { target vect_avg_qi } } } */
53 /* { dg-final { scan-tree-dump-times "vectorized 1 loop" 1 "vect" { target vect_avg_qi } } } */