File: bitopt

package info (click to toggle)
tcng 10b-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,632 kB
  • ctags: 2,515
  • sloc: ansic: 19,038; pascal: 4,640; yacc: 2,619; sh: 1,908; perl: 1,546; lex: 772; makefile: 755
file content (49 lines) | stat: -rw-r--r-- 1,485 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# "if" optimizes (value << shift) & mask --------------------------------------
tcc -xif:err -B 2>&1 | sed '/match \\(.*\\) action.*/s//\\1/p;d'
prio {
    class if ((raw[0].b << 2) & 0xf0) == 16;
}
EOF
0:2:4=0x1
# "if" optimizes ((value & mask) << shift -------------------------------------
tcc -xif:err -B 2>&1 | sed '/match \\(.*\\) action.*/s//\\1/p;d'
prio {
    class if (raw[0].b & 0xf0) << 2 == 0x80;
}
EOF
0:0:4=0x2
# "if" optimizes (value >> shift) & mask --------------------------------------
tcc -xif:err -B 2>&1 | sed '/match \\(.*\\) action.*/s//\\1/p;d'
prio {
    class if ((raw[0].b >> 4) & 7) == 0x4;
}
EOF
0:1:3=0x4
# "if" optimizes ((value & mask) >> shift -------------------------------------
tcc -xif:err -B 2>&1 | sed '/match \\(.*\\) action.*/s//\\1/p;d'
prio {
    class if (raw[0].b & 0xf0) >> 3 == 2;
}
EOF
0:0:4=0x1
# "if" optimizes ((value & mask1) << shift) & mask2 ---------------------------
tcc -xif:err -B 2>&1 | sed '/match \\(.*\\) action.*/s//\\1/p;d'
prio {
    class if (((raw[0].b & 0xf) << 2) & 0xf) == 4;
}
EOF
0:6:2=0x1
# "if" optimizes (value >> shift) << shift ------------------------------------
tcc -xif:err -B 2>&1 | sed '/match \\(.*\\) action.*/s//\\1/p;d'
prio {
    class if (raw[0].b >> 4) << 4 == 0x10;
}
EOF
0:0:4=0x1
# "if" optimizes (value << shift) >> shift ------------------------------------
tcc -xif:err -B 2>&1 | sed '/match \\(.*\\) action.*/s//\\1/p;d'
prio {
    class if (raw[0].b << 4) >> 4 == 3;
}
EOF
0:0:8=0x3