|
23 | 23 |
|
24 | 24 | // Macros for folding cases of a switch statement, for easier readability. |
25 | 25 | // Each macro expands into a sequence of cases, from 0 to N-1, doubling the previous macro. |
26 | | -#define C2(func, N) C1(func, 2 * (N)) C1(func, 2 * (N) + 1) |
27 | | -#define C4(func, N) C2(func, 2 * (N)) C2(func, 2 * (N) + 1) |
28 | | -#define C8(func, N) C4(func, 2 * (N)) C4(func, 2 * (N) + 1) |
29 | | -#define C16(func, N) C8(func, 2 * (N)) C8(func, 2 * (N) + 1) |
30 | | -#define C32(func, N) C16(func, 2 * (N)) C16(func, 2 * (N) + 1) |
31 | | -#define C64(func, N) C32(func, 2 * (N)) C32(func, 2 * (N) + 1) |
32 | | -#define C128(func, N) C64(func, 2 * (N)) C64(func, 2 * (N) + 1) |
33 | | -#define C256(func, N) C128(func, 2 * (N)) C128(func, 2 * (N) + 1) |
34 | | -#define C512(func, N) C256(func, 2 * (N)) C256(func, 2 * (N) + 1) |
35 | | -#define C1024(func, N) C512(func, 2 * (N)) C512(func, 2 * (N) + 1) |
| 26 | +#define C2(func, N) C1(func, 2 * (N)) C1(func, 2 * (N) + 1) |
| 27 | +#define C4(func, N) C2(func, 2 * (N)) C2(func, 2 * (N) + 1) |
| 28 | +#define C8(func, N) C4(func, 2 * (N)) C4(func, 2 * (N) + 1) |
| 29 | +#define C16(func, N) C8(func, 2 * (N)) C8(func, 2 * (N) + 1) |
| 30 | +#define C32(func, N) C16(func, 2 * (N)) C16(func, 2 * (N) + 1) |
| 31 | +#define C64(func, N) C32(func, 2 * (N)) C32(func, 2 * (N) + 1) |
36 | 32 |
|
37 | 33 | // Macros for 8, 16, 32 and 64 cases. Used to collapse the switch statement. |
38 | 34 | // Expands into 0-7, 0-15, 0-31 or 0-63 cases respectively. |
|
50 | 46 | // func: The templated function that we want to choose the implementation for. |
51 | 47 | // chunk: The chunk size. Can be 64, 32, 16 or 8. Should be the number of elements of the expected |
52 | 48 | // type fitting in the expected register size. |
| 49 | +// chunk == 1 means that there's no use of the residual, and we can use the function |
| 50 | +// directly. |
53 | 51 | #define CHOOSE_IMPLEMENTATION(out, dim, chunk, func) \ |
54 | 52 | do { \ |
55 | 53 | decltype(out) __ret_dist_func; \ |
|
0 commit comments