aboutsummaryrefslogtreecommitdiff
path: root/i386-gen.c
diff options
context:
space:
mode:
authorgrischka <grischka>2016-10-16 19:04:40 +0200
committergrischka <grischka>2016-10-16 19:04:40 +0200
commitd9b7f018ce08bdd6b0e35608dbe75ba933622d92 (patch)
treec2e5f22444a9cf1785ab6a551ce729c0254dd4ee /i386-gen.c
parent6245db9fca4046e568da41c6a1f8c51ee9e2f56c (diff)
downloadtinycc-d9b7f018ce08bdd6b0e35608dbe75ba933622d92.tar.gz
tinycc-d9b7f018ce08bdd6b0e35608dbe75ba933622d92.tar.bz2
i386: do not 'lexpand' into registers necessarily
Previously, long longs were 'lexpand'ed into two registers always. Now, it expands - constants into two constants (lo-part, hi-part) - variables into two lvalues with offset+4 for the hi-part. This makes long long operations look a bit nicer. Also: don't apply i386 'inc/dec' optimization if carry generation is wanted.
Diffstat (limited to 'i386-gen.c')
-rw-r--r--i386-gen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/i386-gen.c b/i386-gen.c
index b96e4fb..9cc2f8e 100644
--- a/i386-gen.c
+++ b/i386-gen.c
@@ -754,9 +754,9 @@ ST_FUNC void gen_opi(int op)
c = vtop->c.i;
if (c == (char)c) {
/* generate inc and dec for smaller code */
- if (c==1 && opc==0) {
+ if (c==1 && opc==0 && op != TOK_ADDC1) {
o (0x40 | r); // inc
- } else if (c==1 && opc==5) {
+ } else if (c==1 && opc==5 && op != TOK_SUBC1) {
o (0x48 | r); // dec
} else {
o(0x83);