* device/include/mcs51/at89c51snd1c.h: fixed MSK_SREQ definition
thanks Weston T. Schmidt for patch 1555221
+ * src/mcs51/peeph.def: renamed rule 257 to 257.a, added 257.b
+ * src/SDCCicode.c(geniCodeMultiply): small optimization
2006-09-26 Maarten Brock <sourceforge.brock AT dse.nl>
}
else
{
- ic = newiCode ('*', left, right); /* normal multiplication */
/* if the size left or right > 1 then support routine */
if (getSize (ltype) > 1 || getSize (rtype) > 1)
- ic->supportRtn = 1;
-
+ {
+ if (IS_LITERAL (retype))
+ ic = newiCode ('*', right, left); /* multiplication by support routine with one literal */
+ else
+ ic = newiCode ('*', left, right); /* multiplication by support routine */
+ ic->supportRtn = 1;
+ }
+ else
+ {
+ ic = newiCode ('*', left, right); /* normal multiplication */
+ }
}
IC_RESULT (ic) = newiTempOperand (resType, 1);
// unsigned char i=8; do{ } while(--i != 0);
-// this currently only applies if i is kept in a register
+// this applies if i is kept in a register
replace {
dec %1
cjne %1,#0x00,%2
} by {
- ; Peephole 257 optimized decrement with compare
+ ; Peephole 257.a optimized decrement with compare
djnz %1,%2
-} if notVolatile %1
+} if notVolatile(%1)
+
+// unsigned char i=8; do{ } while(--i != 0);
+// this applies if i is kept in data memory
+replace {
+ dec %1
+ mov a,%1
+ jnz %2
+} by {
+ ; Peephole 257.b optimized decrement with compare
+ djnz %1,%2
+} if notVolatile(%1), operandsNotRelated(%1 '@r0' '@r1')
// in_byte<<=1; if(in_bit) in_byte|=1;