From 7314bcc78908dc4667a845b0bbb0f9023211bba5 Mon Sep 17 00:00:00 2001 From: bernhardheld Date: Tue, 9 Mar 2004 21:56:25 +0000 Subject: [PATCH] * src/SDCCicode.c (geniCodeMultiply): fixed logic for decision if mul is optimized to left shift git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3260 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 2 ++ src/SDCCicode.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 055c1762..8358dabe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ needed for literals of LEFT_OP and '+' * src/SDCCicode.c (geniCodeLogic): I must have been braindead when I introduced RESULT_TYPE_NOPROM + (geniCodeMultiply): fixed logic for decision if mul is optimized to + left shift * src/SDCCsymt.c (computeType): op is int; added RESULT_TYPE_OTHER; limited promotion to int only for '*' * src/SDCCsymt.h (computeType): op is int, removed RESULT_TYPE_NOPROM diff --git a/src/SDCCicode.c b/src/SDCCicode.c index cdd103c0..3364eecf 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -2047,7 +2047,7 @@ geniCodeMultiply (operand * left, operand * right, RESULT_TYPE resultType) efficient in most cases than 2 bytes result = 2 bytes << literal if port has 1 byte muldiv */ if (p2 && !IS_FLOAT (letype) - && !((resultType != RESULT_TYPE_INT) && (getSize (resType) != getSize (ltype)) + && !((resultType == RESULT_TYPE_INT) && (getSize (resType) != getSize (ltype)) && (port->support.muldiv == 1)) && strcmp (port->target, "pic14") != 0 /* don't shift for pic */ && strcmp (port->target, "pic16") != 0) -- 2.39.5