#define PATTERN_INPUTS_COUNT 64
#define PATTERN_INPUTS_SHORT_COUNT 8
-uint64_t b128_pattern[PATTERN_INPUTS_COUNT][2] = {
+static const uint64_t b128_pattern[PATTERN_INPUTS_COUNT][2] = {
{ 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, }, /* 0 */
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xAAAAAAAAAAAAAAAAULL, 0xAAAAAAAAAAAAAAAAULL, },
#define RANDOM_INPUTS_COUNT 16
#define RANDOM_INPUTS_SHORT_COUNT 4
-uint64_t b128_random[RANDOM_INPUTS_COUNT][2] = {
+static const uint64_t b128_random[RANDOM_INPUTS_COUNT][2] = {
{ 0x886AE6CC28625540ULL, 0x4B670B5EFE7BB00CULL, }, /* 0 */
{ 0xFBBE00634D93C708ULL, 0x12F7BB1A153F52FCULL, },
{ 0xAC5AAEAAB9CF8B80ULL, 0x27D8C6FFAB2B2514ULL, },
#include <inttypes.h>
#include <string.h>
-#define PRINT_RESULTS 1
+#define PRINT_RESULTS 0
-static inline int32_t check_results(char *instruction_name,
- uint32_t test_count,
- double elapsed_time,
- uint64_t *b128_result,
- uint64_t *b128_expect)
+static inline int32_t check_results(const char *instruction_name,
+ const uint32_t test_count,
+ const double elapsed_time,
+ const uint64_t *b128_result,
+ const uint64_t *b128_expect)
{
#if PRINT_RESULTS
uint32_t ii;
printf("%s: ", instruction_name);
for (i = 0; i < test_count; i++) {
- if (b128_result[i] == b128_expect[i]) {
+ if ((b128_result[2 * i] == b128_expect[2 * i]) &&
+ (b128_result[2 * i + 1] == b128_expect[2 * i + 1])) {
pass_count++;
} else {
fail_count++;