From 121033e4a69e29a6b375993d445cba018ee4975c Mon Sep 17 00:00:00 2001 From: _ov4 Date: Mon, 9 Nov 2026 11:08:15 +0000 Subject: macro --- cachelab-handout/trans_64.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'cachelab-handout/trans_64.h') 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 \ { \ -- cgit v1.3.1-4-g156e