Right-shifting by a negative value is undefined.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
printf("size=%d\n", size);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
+ int reps = REPS(i);
do {
int sx = rand() % (2*size) - size;
int sy = rand() % (2*size) - size;
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
+ int reps = REPS(i);
+ int sets = SETS(i);
enum target t;
- if (sets < 2)
- sets = 2;
-
for (t = TARGET_FIRST; t <= TARGET_LAST; t++) {
pixel_tests(&test, reps, sets, t);
area_tests(&test, reps, sets, t);
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
+ int reps = REPS(i);
+ int sets = SETS(i);
enum target t;
- if (sets < 2)
- sets = 2;
-
for (t = TARGET_FIRST; t <= TARGET_LAST; t++) {
pixel_tests(&test, reps, sets, t);
area_tests(&test, reps, sets, t);
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
+ int reps = REPS(i);
+ int sets = SETS(i);
enum target t;
- if (sets < 2)
- sets = 2;
-
for (t = TARGET_FIRST; t <= TARGET_LAST; t++) {
pixel_tests(&test, reps, sets, t, 0);
area_tests(&test, reps, sets, t, 0);
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
+ int reps = REPS(i), sets = SETS(i);
enum target t;
- if (sets < 2)
- sets = 2;
-
for (t = TARGET_FIRST; t <= TARGET_LAST; t++) {
zrect_tests(&test, reps, sets, t);
hrect_tests(&test, reps, sets, t);
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int iterations = 1 << i;
+ int iterations = REPS(i);
rect_tests(&test, iterations, 0);
rect_tests(&test, iterations, 1);
}
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
+ int reps = REPS(i), sets = SETS(i);
enum target t;
- if (sets < 2)
- sets = 2;
-
for (t = TARGET_FIRST; t <= TARGET_LAST; t++) {
string_tests(&test, reps, sets, t);
}
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int iterations = 1 << i;
+ int iterations = REPS(i);
rect_tests(&test, iterations, 0);
rect_tests(&test, iterations, 1);
}
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
+ int reps = REPS(i), sets = SETS(i);
enum target t;
- if (sets < 2)
- sets = 2;
-
for (t = TARGET_FIRST; t <= TARGET_LAST; t++)
ref_tests(&test, reps, sets, t);
}
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
+ int reps = REPS(i), sets = SETS(i);
enum target t;
- if (sets < 2)
- sets = 2;
-
for (t = TARGET_FIRST; t <= TARGET_LAST; t++) {
pixel_tests(&test, reps, sets, t);
area_tests(&test, reps, sets, t);
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
-
- if (sets < 2)
- sets = 2;
+ int reps = REPS(i), sets = SETS(i);
pixel_tests(&test, reps, sets, PIXMAP);
area_tests(&test, reps, sets, PIXMAP);
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
+ int reps = REPS(i), sets = SETS(i);
enum target t;
- if (sets < 2)
- sets = 2;
-
for (t = TARGET_FIRST; t <= TARGET_LAST; t++) {
rect_tests(&test, reps, sets, t, 0);
if (t != PIXMAP)
printf("size=%d\n", size);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
+ int reps = REPS(i);
do {
int sx = rand() % (2*size) - size;
int sy = rand() % (2*size) - size;
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
+ int reps = REPS(i), sets = SETS(i);
enum target t;
- if (sets < 2)
- sets = 2;
-
for (t = TARGET_FIRST; t <= TARGET_LAST; t++) {
pixel_tests(&test, reps, sets, t);
area_tests(&test, reps, sets, t);
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
+ int reps = REPS(i), sets = SETS(i);
enum target t;
- if (sets < 2)
- sets = 2;
-
for (t = TARGET_FIRST; t <= TARGET_LAST; t++) {
pixel_tests(&test, reps, sets, t);
area_tests(&test, reps, sets, t);
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
+ int reps = REPS(i), sets = SETS(i);
enum target t;
- if (sets < 2)
- sets = 2;
-
for (t = TARGET_FIRST; t <= TARGET_LAST; t++) {
pixel_tests(&test, reps, sets, t);
area_tests(&test, reps, sets, t);
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
-
- if (sets < 2)
- sets = 2;
+ int reps = REPS(i), SETS(i);
for (target = TARGET_FIRST; target <= TARGET_LAST; target++) {
pixel_tests(&test, reps, sets, target, 0);
test_init(&test, argc, argv);
for (i = 0; i <= DEFAULT_ITERATIONS; i++) {
- int reps = 1 << i;
- int sets = 1 << (12 - i);
-
- if (sets < 2)
- sets = 2;
+ int reps = REPS(i), sets = SETS(i);
for (target = TARGET_FIRST; target <= TARGET_LAST; target++) {
pixel_tests(&test, reps, sets, target);
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#endif
+#define REPS(I) (1 << (I))
+#define SETS(I) ((I) < 12 ? 1 << (12 - (I)) : 2)
+
#endif