re PR tree-optimization/89007 ([SVE] Implement generic vector average expansion)
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / pr89007-2.c
blob2ccdd0d353ebbbdeea44086b1954f8c893de1638
1 /* { dg-do assemble { target aarch64_asm_sve_ok } } */
2 /* { dg-options "-O -ftree-vectorize -march=armv8.2-a+sve --save-temps" } */
3 /* { dg-final { check-function-bodies "**" "" } } */
5 #define N 1024
6 unsigned char dst[N];
7 unsigned char in1[N];
8 unsigned char in2[N];
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 ** and (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 ** ...
21 void
22 foo ()
24 for( int x = 0; x < N; x++ )
25 dst[x] = (in1[x] + in2[x]) >> 1;
28 /* { dg-final { scan-assembler-not {\tuunpklo\t} } } */
29 /* { dg-final { scan-assembler-not {\tuunpkhi\t} } } */