Added support for the op_bXX conditional branch instructions.

This commit is contained in:
David Given 2016-10-04 23:28:16 +02:00
parent 249855ed23
commit 8fedf5a0a8
2 changed files with 14 additions and 0 deletions

View file

@ -158,6 +158,12 @@ static void queue_insn_ilabel(int opcode, int label)
case op_zle:
case op_zgt:
case op_zge:
case op_beq:
case op_bne:
case op_blt:
case op_ble:
case op_bgt:
case op_bge:
{
struct basicblock* bb = bb_get(NULL);
queue_insn_block(em.em_opcode, left, bb);

View file

@ -270,6 +270,14 @@ static void insn_bvalue(int opcode, struct basicblock* leftbb, struct basicblock
case op_zge: compare0_branch2(opcode, rightbb, leftbb, IR_CJUMPLT); break;
case op_zgt: compare0_branch2(opcode, rightbb, leftbb, IR_CJUMPLE); break;
case op_beq: simple_branch2(opcode, EM_wordsize, leftbb, rightbb, IR_CJUMPEQ); break;
case op_blt: simple_branch2(opcode, EM_wordsize, leftbb, rightbb, IR_CJUMPLT); break;
case op_ble: simple_branch2(opcode, EM_wordsize, leftbb, rightbb, IR_CJUMPLE); break;
case op_bne: simple_branch2(opcode, EM_wordsize, rightbb, leftbb, IR_CJUMPEQ); break;
case op_bge: simple_branch2(opcode, EM_wordsize, rightbb, leftbb, IR_CJUMPLT); break;
case op_bgt: simple_branch2(opcode, EM_wordsize, rightbb, leftbb, IR_CJUMPLE); break;
case op_bra:
{
materialise_stack();