Skip to content

Commit

Permalink
Support loading values from int16 arrays in expr JIT
Browse files Browse the repository at this point in the history
  • Loading branch information
niner committed Jul 30, 2021
1 parent f08c7f9 commit 134ed51
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/jit/x64/tiles.dasc
Expand Up @@ -21,9 +21,14 @@ MVM_JIT_TILE_DECL(idx) {
MVMint8 base = tile->values[1];
MVMint8 idx = tile->values[2];
MVMint8 scl = tile->args[0];
if (scl == 8) {
switch(scl) {
case 2:
| lea Rq(out), [Rq(base)+Rq(idx)*2];
break;
case 8:
| lea Rq(out), [Rq(base)+Rq(idx)*8];
} else {
break;
default:
DIE("Unsupported scale: %d", scl);
}
}
Expand Down Expand Up @@ -108,15 +113,22 @@ MVM_JIT_TILE_DECL(load_idx) {
MVMint8 idx = tile->values[2];
MVMint8 scl = tile->args[0];
MVMint32 size = tile->args[1];
if (scl != 8) {
if (scl != 8 && size != 2) {
DIE("Unsupported scale size: %d\n", scl);
}
switch (size) {
case 1:
| mov Rb(out), byte [Rq(base)+Rq(idx)*8];
break;
case 2:
| mov Rw(out), word [Rq(base)+Rq(idx)*8];
switch(scl) {
case 2:
| mov Rw(out), word [Rq(base)+Rq(idx)*2];
break;
case 8:
| mov Rw(out), word [Rq(base)+Rq(idx)*8];
break;
}
break;
case 4:
| mov Rd(out), dword [Rq(base)+Rq(idx)*8];
Expand Down

0 comments on commit 134ed51

Please sign in to comment.