diff options
| author | Mike Vink <mike@pionative.com> | 2024-06-14 09:23:32 +0200 |
|---|---|---|
| committer | Mike Vink <mike@pionative.com> | 2024-06-14 09:23:32 +0200 |
| commit | 8092f4c334db547ced59d6f439b558dad35e1ab2 (patch) | |
| tree | fa462fa885efea1ec6095d015286998d632c2c3d /3/8_array_allocation_and_access/39_explain_rows_cols.c | |
| parent | b424517a33bf61aedff29eed74a665402ab496ba (diff) | |
commit for once
Diffstat (limited to '3/8_array_allocation_and_access/39_explain_rows_cols.c')
| -rw-r--r-- | 3/8_array_allocation_and_access/39_explain_rows_cols.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/3/8_array_allocation_and_access/39_explain_rows_cols.c b/3/8_array_allocation_and_access/39_explain_rows_cols.c new file mode 100644 index 0000000..7304f23 --- /dev/null +++ b/3/8_array_allocation_and_access/39_explain_rows_cols.c @@ -0,0 +1,8 @@ +// addq %rdx, %rdi Aptr = xa + 64i +// fix_matrix = int[16][16], so each int is 4 bytes and we need to multiple by the number of columns to find the +// i row, A + L(C*i + j) <=> A + 4(16*i) +// +// leaq (%rsi, %rcx, 4), %rcx Bptr = xb + 4k, this one is simple B + L(C*i + j) <=> B + 4(j), find the first row of the column j +// +// leaq 1024(%rcx), %rsi Bend = xb + 4k + 1024, find the N row of column k, +// B + 4(16*16 + k) <=> B + 1024 + 4k |
