diff options
| author | _ov4 <ov4@ov4.org> | 2026-11-09 11:08:15 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-11-09 11:08:15 +0000 |
| commit | 121033e4a69e29a6b375993d445cba018ee4975c (patch) | |
| tree | b3793282c5eb0edc1d0e6f7ad09251d1a6626a2c /cachelab-handout/trans_64.h | |
| parent | 45b30cfcd4c5c133ab16fa0338e0f38f75b37751 (diff) | |
macro
Diffstat (limited to 'cachelab-handout/trans_64.h')
| -rw-r--r-- | cachelab-handout/trans_64.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cachelab-handout/trans_64.h b/cachelab-handout/trans_64.h index 542866e..1f6fed5 100644 --- a/cachelab-handout/trans_64.h +++ b/cachelab-handout/trans_64.h @@ -1,5 +1,21 @@ #pragma once +#define TRANSPOSE_4_BY_4(base_i_A, base_j_A, base_i_B, base_j_B, tmp) \ +do \ +{ \ +for (tmp = 0; tmp < 4; tmp++) \ +{ \ + t0 = A[base_i_A + tmp][base_j_A + 0]; \ + t1 = A[base_i_A + tmp][base_j_A + 1]; \ + t2 = A[base_i_A + tmp][base_j_A + 2]; \ + t3 = A[base_i_A + tmp][base_j_A + 3]; \ + B[base_i_B + 0][base_j_B + tmp] = t0; \ + B[base_i_B + 1][base_j_B + tmp] = t1; \ + B[base_i_B + 2][base_j_B + tmp] = t2; \ + B[base_i_B + 3][base_j_B + tmp] = t3; \ +} \ +} while (0) + #define CP_4_BY_8(base_i, base_j, tmp) \ do \ { \ |
