Add inl and del opcodes.
This commit is contained in:
parent
b298c27c63
commit
bf73fcdb64
1 changed files with 26 additions and 0 deletions
|
@ -340,6 +340,24 @@ static struct ir* extract_block_refs(struct basicblock* bb)
|
||||||
return outir;
|
return outir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void change_by(struct ir* address, int amount)
|
||||||
|
{
|
||||||
|
appendir(
|
||||||
|
new_ir2(
|
||||||
|
IR_STORE, EM_wordsize,
|
||||||
|
address,
|
||||||
|
new_ir2(
|
||||||
|
IR_ADD, EM_wordsize,
|
||||||
|
new_ir1(
|
||||||
|
IR_LOAD, EM_wordsize,
|
||||||
|
address
|
||||||
|
),
|
||||||
|
new_wordir(amount)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
static void insn_ivalue(int opcode, arith value)
|
static void insn_ivalue(int opcode, arith value)
|
||||||
{
|
{
|
||||||
switch (opcode)
|
switch (opcode)
|
||||||
|
@ -387,6 +405,14 @@ static void insn_ivalue(int opcode, arith value)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case op_inl:
|
||||||
|
change_by(new_localir(value), 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case op_del:
|
||||||
|
change_by(new_localir(value), -1);
|
||||||
|
break;
|
||||||
|
|
||||||
case op_loc:
|
case op_loc:
|
||||||
push(
|
push(
|
||||||
new_wordir(value)
|
new_wordir(value)
|
||||||
|
|
Loading…
Reference in a new issue