|
|
@ -3,31 +3,39 @@ |
|
|
|
|
|
|
|
|
|
|
|
int |
|
|
|
int |
|
|
|
main() { |
|
|
|
main() { |
|
|
|
unsigned char a[BITMAP_SIZE], b[BITMAP_SIZE]; |
|
|
|
unsigned char a[SIMDB_BITMAP_SIZE]; |
|
|
|
|
|
|
|
unsigned char b[SIMDB_BITMAP_SIZE]; |
|
|
|
|
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
|
|
memset (a, 0x00, sizeof(a)); |
|
|
|
memset (a, 0x00, sizeof(a)); |
|
|
|
memset (b, 0x00, sizeof(b)); |
|
|
|
memset (b, 0x00, sizeof(b)); |
|
|
|
assert(bitmap_compare(a, b) == 0); |
|
|
|
ret = simdb_bitmap_compare(a, b); |
|
|
|
|
|
|
|
assert(ret == 0); |
|
|
|
|
|
|
|
|
|
|
|
memset (a, 0xFE, sizeof(a)); |
|
|
|
memset (a, 0xFE, sizeof(a)); |
|
|
|
memset (b, 0xFF, sizeof(b)); |
|
|
|
memset (b, 0xFF, sizeof(b)); |
|
|
|
assert(bitmap_compare(a, b) == 32); |
|
|
|
ret = simdb_bitmap_compare(a, b); |
|
|
|
|
|
|
|
assert(ret == 32); |
|
|
|
|
|
|
|
|
|
|
|
memset (a, 0x00, sizeof(a)); |
|
|
|
memset (a, 0x00, sizeof(a)); |
|
|
|
memset (b, 0x55, sizeof(b)); |
|
|
|
memset (b, 0x55, sizeof(b)); |
|
|
|
assert(bitmap_compare(a, b) == 128); |
|
|
|
ret = simdb_bitmap_compare(a, b); |
|
|
|
|
|
|
|
assert(ret == 128); |
|
|
|
|
|
|
|
|
|
|
|
memset (a, 0x00, sizeof(a)); |
|
|
|
memset (a, 0x00, sizeof(a)); |
|
|
|
memset (b, 0xAA, sizeof(b)); |
|
|
|
memset (b, 0xAA, sizeof(b)); |
|
|
|
assert(bitmap_compare(a, b) == 128); |
|
|
|
ret = simdb_bitmap_compare(a, b); |
|
|
|
|
|
|
|
assert(ret == 128); |
|
|
|
|
|
|
|
|
|
|
|
memset (a, 0xAA, sizeof(a)); |
|
|
|
memset (a, 0xAA, sizeof(a)); |
|
|
|
memset (b, 0x55, sizeof(b)); |
|
|
|
memset (b, 0x55, sizeof(b)); |
|
|
|
assert(bitmap_compare(a, b) == 256); |
|
|
|
ret = simdb_bitmap_compare(a, b); |
|
|
|
|
|
|
|
assert(ret == 256); |
|
|
|
|
|
|
|
|
|
|
|
memset (a, 0x00, sizeof(a)); |
|
|
|
memset (a, 0x00, sizeof(a)); |
|
|
|
memset (b, 0xFF, sizeof(b)); |
|
|
|
memset (b, 0xFF, sizeof(b)); |
|
|
|
assert(bitmap_compare(a, b) == 256); |
|
|
|
ret = simdb_bitmap_compare(a, b); |
|
|
|
|
|
|
|
assert(ret == 256); |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|