Debian Codegraph @

gcc/testsuite/gcc.target/i386/bt-6.c

raw
1 /* PR rtl-optimization/46235 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -mtune=core2" } */
4
5 unsigned char set1_bb (unsigned char x, int y)
6 {
7 return (x & (1<<y)) != 0;
8 }
9
10 unsigned char set2_bb (unsigned char x, int y)
11 {
12 return (x >> y) & 1;
13 }
14
15 unsigned char set1_wb (int x, int y)
16 {
17 return (x & (1<<y)) != 0;
18 }
19
20 unsigned char set2_wb (int x, int y)
21 {
22 return (x >> y) & 1;
23 }
24
25 unsigned char clr1_bb (unsigned char x, int y)
26 {
27 return (x & (1<<y)) == 0;
28 }
29
30 unsigned char clr2_bb (unsigned char x, int y)
31 {
32 return !((x >> y) & 1);
33 }
34
35 unsigned char clr1_wb (int x, int y)
36 {
37 return (x & (1<<y)) == 0;
38 }
39
40 unsigned char clr2_wb (int x, int y)
41 {
42 return !((x >> y) & 1);
43 }
44
45 int clr1_bw (unsigned char x, int y)
46 {
47 return (x & (1<<y)) == 0;
48 }
49
50 int clr2_bw (unsigned char x, int y)
51 {
52 return !((x >> y) & 1);
53 }
54
55 int clr1_ww (int x, int y)
56 {
57 return (x & (1<<y)) == 0;
58 }
59
60 int clr2_ww (int x, int y)
61 {
62 return !((x >> y) & 1);
63 }
64
65 /* { dg-final { scan-assembler-times "bt\[lq\]\[ \t\]" 12 } } */
66 /* { dg-final { scan-assembler-not "sar\[lq\]\[ \t\]" } } */
67 /* { dg-final { scan-assembler-not "and\[lq\]\[ \t\]" } } */
68 /* { dg-final { scan-assembler-not "not\[lq\]\[ \t\]" } } */
69