diff options
| author | Thomas Preud'homme <robotux@celest.fr> | 2013-12-31 23:51:20 +0800 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2014-01-04 21:10:05 +0800 |
| commit | eda2c756edc4dca004ba217d5bf361235dd9de1f (patch) | |
| tree | 9370d81f4a5a3c18dc12e76b77c8db133af33032 /i386-gen.c | |
| parent | c634c797c5211a044bc76c4419abef7872a98918 (diff) | |
| download | tinycc-eda2c756edc4dca004ba217d5bf361235dd9de1f.tar.gz tinycc-eda2c756edc4dca004ba217d5bf361235dd9de1f.tar.bz2 | |
Move logic for if (int value) to tccgen.c
Move the logic to do a test of an integer value (ex if (0)) out of
arch-specific code to tccgen.c to avoid code duplication. This also
fixes test of long long value which was only testing the bottom half of
such values on 32 bits architectures.
Diffstat (limited to 'i386-gen.c')
| -rw-r--r-- | i386-gen.c | 19 |
1 files changed, 1 insertions, 18 deletions
@@ -682,7 +682,7 @@ ST_FUNC int gtst(int inv, int t) /* fast case : can jump directly since flags are set */ g(0x0f); t = psym((vtop->c.i - 16) ^ inv, t); - } else if (v == VT_JMP || v == VT_JMPI) { + } else { /* VT_JMP || VT_JMPI */ /* && or || optimization */ if ((v & 1) == inv) { /* insert vtop->c jump list in t */ @@ -695,23 +695,6 @@ ST_FUNC int gtst(int inv, int t) t = gjmp(t); gsym(vtop->c.i); } - } else { - if (is_float(vtop->type.t) || - (vtop->type.t & VT_BTYPE) == VT_LLONG) { - vpushi(0); - gen_op(TOK_NE); - } - if ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST) { - /* constant jmp optimization */ - if ((vtop->c.i != 0) != inv) - t = gjmp(t); - } else { - v = gv(RC_INT); - o(0x85); - o(0xc0 + v * 9); - g(0x0f); - t = psym(0x85 ^ inv, t); - } } vtop--; return t; |
