git://scm.lunaixsky.com
/
lunaix-os.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
23843900cd7d9767d279370b36d92967683274c2
[lunaix-os.git]
/
lunaix-os
/
arch
/
i386
/
klib
/
fast_crc.c
1
#include <lunaix/types.h>
2
#include <klibc/crc.h>
3
4
#ifdef CONFIG_X86_SSE4
5
unsigned int
6
crc32b(unsigned char* data, unsigned int size)
7
{
8
unsigned int ret;
9
asm volatile(
10
"xorl %%ebx, %%ebx\n"
11
"xorl %%eax, %%eax\n"
12
"1:\n"
13
"crc32 (%%edx, %%ebx, 1), %%eax\n"
14
"incl %%ebx\n"
15
"cmpl %%ebx, %%ecx\n"
16
"jne 1b\n"
17
: "=a"(ret)
18
: "d"((ptr_t)data),
19
"c"(size)
20
:
21
);
22
return ret;
23
}
24
#endif