Debian Codegraph @

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

raw
1 /* { dg-do compile { target aarch64*-*-* } } */
2 /* { dg-options "-O3" } */
3
4 #pragma GCC target "+nosve"
5
6 #include <stdint.h>
7
8 #define SSRA(func, vtype, n) \
9 void func () \
10 { \
11 int i; \
12 for (i = 0; i < n; i++) \
13 { \
14 s1##vtype[i] += s2##vtype[i] >> 2; \
15 } \
16 }
17
18 #define TEST_VDQ_I_MODES(FUNC) \
19 FUNC (test_v8qi_v16qi, _char, 16) \
20 FUNC (test_v4hi_v8h1, _short, 8) \
21 FUNC (test_v2si_v4si, _int, 4) \
22 FUNC (test_v2di, _ll, 2) \
23
24 int8_t s1_char[16], s2_char[16];
25 int16_t s1_short[8], s2_short[8];
26 int32_t s1_int[4], s2_int[4];
27 int64_t s1_ll[2], s2_ll[2];
28
29 TEST_VDQ_I_MODES(SSRA)
30
31 /* { dg-final { scan-assembler "ssra" } } */
32 /* { dg-final { scan-assembler-not "sshr" } } */
33
34 /* { dg-final { scan-assembler-times {ssra\tv[0-9]+\.16b, v[0-9]+\.16b, [0-9]+} 1 } } */
35 /* { dg-final { scan-assembler-times {ssra\tv[0-9]+\.8h, v[0-9]+\.8h, [0-9]+} 1 } } */
36 /* { dg-final { scan-assembler-times {ssra\tv[0-9]+\.4s, v[0-9]+\.4s, [0-9]+} 1 } } */
37 /* { dg-final { scan-assembler-times {ssra\tv[0-9]+\.2d, v[0-9]+\.2d, [0-9]+} 1 } } */