/* * Truth-table tests: all 4-input constant vectors */ static void truth_table_test4(void (*f)(uint32_t, literal_t *, literal_t *)) { literal_t a[4]; literal_t b[4]; uint32_t x, y; printf("Size 4\n"); for (x=0; x<16; x++) { uint32_to_litarray(x, 4, a); for (y=0; y<16; y++) { uint32_to_litarray(y, 4, b); f(4, a, b); } } printf("\n"); }
/* * Truth-table tests: all 4-input constant vectors */ static void truth_table_test4(void (*f)(uint32_t, literal_t *)) { literal_t a[4]; uint32_t x; printf("Size 4\n"); for (x=0; x<16; x++) { uint32_to_litarray(x, 4, a); f(4, a); } printf("\n"); }
/* * All constant shifts: 6bits */ static void all_shift_test6(void (*f)(uint32_t, literal_t *, literal_t *)) { literal_t a[6]; literal_t b[6]; uint32_t i, y; for (y=0; y<64; y++) { uint32_to_litarray(y, 6, b); for (i=0; i<6; i++) { a[i] = fresh_lit(); } f(6, a, b); } }
/* * All constant shifts: 4bits */ static void all_shift_test4(void (*f)(uint32_t, literal_t *, literal_t *)) { literal_t a[4]; literal_t b[4]; uint32_t i, y; for (y=0; y<16; y++) { uint32_to_litarray(y, 4, b); for (i=0; i<4; i++) { a[i] = fresh_lit(); } f(4, a, b); } }