Skip to content

Commit

Permalink
Teach the lego JIT to compile hllbool, too
Browse files Browse the repository at this point in the history
  • Loading branch information
niner committed Aug 17, 2018
1 parent 12cea5c commit cd43ab9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/jit/graph.c
Expand Up @@ -1803,6 +1803,7 @@ static MVMint32 consume_ins(MVMThreadContext *tc, MVMJitGraph *jg,
case MVM_OP_ordfirst:
case MVM_OP_getcodename:
case MVM_OP_setcodeobj:
case MVM_OP_hllbool:
/* Profiling */
case MVM_OP_prof_enterspesh:
case MVM_OP_prof_enterinline:
Expand Down
17 changes: 17 additions & 0 deletions src/jit/x64/emit.dasc
Expand Up @@ -2227,6 +2227,23 @@ void MVM_jit_emit_primitive(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMJ
}
break;
}
case MVM_OP_hllbool: {
MVMint16 target = ins->operands[0].reg.orig;
MVMint16 value = ins->operands[1].reg.orig;
MVMHLLConfig *hll_config = (MVMHLLConfig*)jg->sg->sf->body.cu->body.hll_config;
MVMObject *true_value = hll_config->true_value;
MVMObject *false_value = hll_config->false_value;
| mov TMP1, WORK[value];
| test TMP1, TMP1;
| jnz >1;
| mov TMP1, aword false_value;
| jmp >2;
|1:
| mov TMP1, aword true_value;
|2:
| mov WORK[target], TMP1;
break;
}
case MVM_OP_hllboolfor: {
MVMint16 target = ins->operands[0].reg.orig;
MVMint16 value = ins->operands[1].reg.orig;
Expand Down

0 comments on commit cd43ab9

Please sign in to comment.