Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr109011-b1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=icelake-server -O3" } */
3 /* { dg-final { scan-assembler-times "vpopcntb\[ \t\]+" 4 } } */
4 /* 4 vplzcntd come from function clzw, the other 4 come from function clzb0. */
5 /* { dg-final { scan-assembler-times "vplzcntd\[ \t\]+" 8 } } */
6
7 void
8 __attribute__((noipa))
9 popcntb (unsigned char *p, unsigned char *q)
10 {
11 for (unsigned int i = 0; i < 2048; ++i)
12 p[i] = __builtin_popcount (q[i]);
13 }
14
15 void
16 __attribute__((noipa))
17 clzb (unsigned char *p, unsigned char* __restrict q)
18 {
19 for (unsigned int i = 0; i < 2048; ++i)
20 p[i] = __builtin_clz (q[i]);
21 }
22
23 void
24 __attribute__((noipa))
25 ffsb (unsigned char *p, unsigned char* __restrict q)
26 {
27 for (unsigned int i = 0; i < 2048; ++i)
28 p[i] = __builtin_ffs (q[i]);
29 }
30
31 void
32 __attribute__((noipa))
33 ctzb (unsigned char *p, unsigned char* __restrict q)
34 {
35 for (unsigned int i = 0; i < 2048; ++i)
36 p[i] = __builtin_ctz (q[i]);
37 }
38
39 void
40 __attribute__((noipa))
41 clzb0 (unsigned char *p, unsigned char* __restrict q)
42 {
43 for (unsigned int i = 0; i < 2048; ++i)
44 p[i] = q[i] ? __builtin_clz (q[i]) : 8;
45 }
46
47 void
48 __attribute__((noipa))
49 ctzb0 (unsigned char *p, unsigned char* __restrict q)
50 {
51 for (unsigned int i = 0; i < 2048; ++i)
52 p[i] = q[i] ? __builtin_ctz (q[i]) : 8;
53 }