Skip to content

Assembly code for range extraction `mat[a..b]` and concatenation `mat[a;b]`

HARDY FLORENT requested to merge feat-assembly-matrix-extraction into main

Assembly code for line and column range extractions and concatenation of matrixes.

Combination of extractions mat[a..b][c..d] are equivalent to

matrix mat;
// ...
matrix tmp = mat[a..b][*];
matrix res = tmp[*][c..d];

Range extractions permit ranges as : mat[0..0][*] == mat[0][*]

Combination of concatenations mat[a;b][c;d] are equivalent to :

matrix mat;
// ...
matrix tmp = concat_lin(mat[a][*], mat[b][*]);
matrix res = concat_col(tmp[*][c], tmp[*][d]);

The range extraction '..' operator has higher priority. Therefore, combination of both mat[a..b;c][d;e] are equivalent to :

matrix mat;
// ...
matrix tmp1 = mat[a..b][*];
matrix tmp2 = concat_lin(tmp1[*][*], mat[c][*]);
matrix res = concat_col(tmp2[*][d], tmp2[*][e]);

Sidenote : range extractions can be used to extract 1-dimensional matrices :

mat[0][*] == mat[0..0][*]

Merge request reports