blob: dee9dc37d1599ede0b07a6e220232f3b72b34fc2 (
plain)
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
|
byte_match_count2 (buf, n, xm, m1, m2, m3, m4)
unsigned *buf;
unsigned n;
unsigned xm;
unsigned m1, m2, m3, m4;
{
unsigned w, cnt = 0;
unsigned *bp;
n /= 4;
bp = buf;
while (bp < buf + n)
{
w = *bp++;
w ^= xm;
cnt += ((m1 & w) == 0);
cnt += ((m2 & w) == 0);
cnt += ((m3 & w) == 0);
cnt += ((m4 & w) == 0);
w = *bp++;
w ^= xm;
cnt += ((m1 & w) == 0);
cnt += ((m2 & w) == 0);
cnt += ((m3 & w) == 0);
cnt += ((m4 & w) == 0);
w = *bp++;
w ^= xm;
cnt += ((m1 & w) == 0);
cnt += ((m2 & w) == 0);
cnt += ((m3 & w) == 0);
cnt += ((m4 & w) == 0);
w = *bp++;
w ^= xm;
cnt += ((m1 & w) == 0);
cnt += ((m2 & w) == 0);
cnt += ((m3 & w) == 0);
cnt += ((m4 & w) == 0);
}
return cnt;
}
|