1 /* { dg-do assemble { target aarch64_asm_sve_ok } } */
2 /* { dg-options "-O -ftree-vectorize -march=armv8.2-a+sve -msve-vector-bits=512 --save-temps" } */
3 /* { dg-final { check-function-bodies "**" "" } } */
4 
5 #define N 1024
6 unsigned char dst[N];
7 unsigned char in1[N];
8 unsigned char in2[N];
9 
10 /*
11 **  foo:
12 **	...
13 **	lsr	(z[0-9]+\.b), z[0-9]+\.b, #1
14 **	lsr	(z[0-9]+\.b), z[0-9]+\.b, #1
15 **	add	(z[0-9]+\.b), (\1, \2|\2, \1)
16 **	orr	(z[0-9]+)\.d, z[0-9]+\.d, z[0-9]+\.d
17 **	and	(z[0-9]+\.b), \5\.b, #0x1
18 **	add	z0\.b, (\3, \6|\6, \3)
19 **	...
20 */
21 void
foo()22 foo ()
23 {
24   for( int x = 0; x < N; x++ )
25     dst[x] = (in1[x] + in2[x] + 1) >> 1;
26 }
27 
28 /* { dg-final { scan-assembler-not {\tuunpklo\t} } } */
29 /* { dg-final { scan-assembler-not {\tuunpkhi\t} } } */
30