mirror of
https://github.com/frida/tinycc
synced 2024-11-24 08:39:37 +03:00
generate inc and dec for smaller code
This commit is contained in:
parent
27bcc8f583
commit
d3c432244c
14
i386-gen.c
Normal file → Executable file
14
i386-gen.c
Normal file → Executable file
@ -686,10 +686,16 @@ ST_FUNC void gen_opi(int op)
|
|||||||
vswap();
|
vswap();
|
||||||
c = vtop->c.i;
|
c = vtop->c.i;
|
||||||
if (c == (char)c) {
|
if (c == (char)c) {
|
||||||
/* XXX: generate inc and dec for smaller code ? */
|
/* generate inc and dec for smaller code */
|
||||||
o(0x83);
|
if (c==1 && opc==0) {
|
||||||
o(0xc0 | (opc << 3) | r);
|
o (0x40 | r); // inc
|
||||||
g(c);
|
} else if (c==1 && opc==5) {
|
||||||
|
o (0x48 | r); // dec
|
||||||
|
} else {
|
||||||
|
o(0x83);
|
||||||
|
o(0xc0 | (opc << 3) | r);
|
||||||
|
g(c);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
o(0x81);
|
o(0x81);
|
||||||
oad(0xc0 | (opc << 3) | r, c);
|
oad(0xc0 | (opc << 3) | r, c);
|
||||||
|
Loading…
Reference in New Issue
Block a user