summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e42c2c9)
if condition == CARRY)
* (genCmp): adapted to new genSkipc semantics
* src/pic16/genutils.c (pic6_genCmp_special): removed side effect
on rIfx (genCmp was broken)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3708
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2005-03-26 Raphael Neider <rneider AT web.de>
+
+ * src/pic16/gen.c (genSkipc): fixed semantics (execute branch
+ if condition == CARRY)
+ * (genCmp): adapted to new genSkipc semantics
+ * src/pic16/genutils.c (pic6_genCmp_special): removed side effect
+ on rIfx (genCmp was broken)
+
2005-03-26 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
* src/SDCCmain.c (setDefaultOptions, optionsTable[], parseCmdLine),
2005-03-26 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
* src/SDCCmain.c (setDefaultOptions, optionsTable[], parseCmdLine),
return;
if(rifx->condition)
return;
if(rifx->condition)
pic16_emitpcode(POC_GOTO, pic16_popGetLabel(rifx->lbl->key));
rifx->generated = 1;
pic16_emitpcode(POC_GOTO, pic16_popGetLabel(rifx->lbl->key));
rifx->generated = 1;
} // if
// This fails for lit = 0xFF (unsigned) AND lit = 0x7F (signed),
} // if
// This fails for lit = 0xFF (unsigned) AND lit = 0x7F (signed),
- // that's we handled it above.
+ // that's why we handled it above.
* now CARRY contains the result of the comparison: *
* SUBWF sets CARRY iff *
* F-W >= 0 <==> F >= W <==> !(F < W) *
* now CARRY contains the result of the comparison: *
* SUBWF sets CARRY iff *
* F-W >= 0 <==> F >= W <==> !(F < W) *
****************************************************/
if (performedLt) {
****************************************************/
if (performedLt) {
} // if (result)
// perform conditional jump
} // if (result)
// perform conditional jump
- // genSkipc branches to rifx->label if (rifx->condition != CARRY)
if (ifx) {
//DEBUGpc ("generate control flow");
if (ifx) {
//DEBUGpc ("generate control flow");
genSkipc (&rIfx);
ifx->generated = 1;
} // if
genSkipc (&rIfx);
ifx->generated = 1;
} // if
int offs=0;
symbol *tmplbl;
unsigned long lit;
int offs=0;
symbol *tmplbl;
unsigned long lit;
+ int op, cmp_op=0, cond_pre;
FENTRY;
if(!(pic16_options.opt_flags & OF_OPTIMIZE_CMP))return 0;
size = max(AOP_SIZE(left), AOP_SIZE(right));
FENTRY;
if(!(pic16_options.opt_flags & OF_OPTIMIZE_CMP))return 0;
size = max(AOP_SIZE(left), AOP_SIZE(right));
+
+ cond_pre = rIfx->condition; // must restore old value on return with 0!!!
if(!isAOP_REGlike(left)) {
operand *dummy;
if(!isAOP_REGlike(left)) {
operand *dummy;
+ rIfx->condition = cond_pre;