Skip to content

feat: add matrix extraction to IR translation

Arch de Noé requested to merge feat-ir-matrix-extraction into main

Matrix extraction operations are now supported and translated to IR.

The implementations uses the procedures _range<Line|Column>Extraction and _concat<Line|Column>.

Example

Source :

matrix top_left_corner[2][2] = original[0..1][0..1];

IR :

000 │   arg $16
001 │   arg $11
002 │   arg $12
003 │   arg $13
004 │   call $7
005 │   arg $17
006 │   arg $16
007 │   arg $14
008 │   arg $15
009 │   call $9
010 │   $18 = $17
011 │   exit

ST:

functions :

$7  : _rangeLineExtraction           │ (matrix, matrix, int, int) -> void
$8  : _concatLine                    │ (matrix, matrix, matrix) -> void  
$9  : _rangeColumnExtraction         │ (matrix, matrix, int, int) -> void
$10 : _concatColumn  	             │ (matrix, matrix, matrix) -> void

vars :

$11 : original          │ matrix[3][3] │ {...}       │
$12 : __cmat_temp_0     │ int          │ 0           │
$13 : __cmat_temp_1     │ int          │ 1           │
$14 : __cmat_temp_2     │ int          │ 0           │
$15 : __cmat_temp_3     │ int          │ 1           │
$16 : __cmat_temp_4     │ matrix[2][3] │ undefined   │
$17 : __cmat_temp_5     │ matrix[2][2] │ undefined   │
$18 : top_left_corner   │ matrix[2][2] │ undefined   │
Edited by Arch de Noé

Merge request reports