Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/simd/pr99195_10.c

raw
1 /* PR target/99195. */
2 /* Check that we take advantage of 64-bit Advanced SIMD operations clearing
3 the top half of the vector register and no explicit zeroing instructions
4 are emitted. */
5 /* { dg-do compile } */
6 /* { dg-options "-O -march=armv8.1-a+rdma" } */
7
8 #include <arm_neon.h>
9
10 #define OPTWO(T,IS,OS,S,OP1,OP2) \
11 FUNC (T, IS, OS, OP1, S) \
12 FUNC (T, IS, OS, OP2, S)
13
14 #define TERNARY(OT,IT,OP,S) \
15 OT \
16 foo_##OP##_##S (IT a, IT b, IT c) \
17 { \
18 IT zeros = vcreate_##S (0); \
19 return vcombine_##S (v##OP##_##S (a, b, c), zeros); \
20 }
21
22 #undef FUNC
23 #define FUNC(T,IS,OS,OP,S) TERNARY (T##x##OS##_t, T##x##IS##_t, OP, S)
24
25 OPTWO (int16, 4, 8, s16, qrdmlah, qrdmlsh)
26 OPTWO (int32, 2, 4, s32, qrdmlah, qrdmlsh)
27
28 #define TERNARY_IDX(OT,IT,OP,S) \
29 OT \
30 foo_##OP##_##S (IT a, IT b, IT c) \
31 { \
32 IT zeros = vcreate_##S (0); \
33 return vcombine_##S (v##OP##_##S (a, b, c, 0), zeros); \
34 }
35
36 #undef FUNC
37 #define FUNC(T,IS,OS,OP,S) TERNARY_IDX (T##x##OS##_t, T##x##IS##_t, OP, S)
38 OPTWO (int16, 4, 8, s16, qrdmlah_lane, qrdmlsh_lane)
39 OPTWO (int32, 2, 4, s32, qrdmlah_lane, qrdmlsh_lane)
40
41 /* { dg-final { scan-assembler-not {\tfmov\t} } } */
42 /* { dg-final { scan-assembler-not {\tmov\t} } } */
43