* doc/sdccman.lyx,
authortecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 4 Aug 2008 15:54:43 +0000 (15:54 +0000)
committertecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 4 Aug 2008 15:54:43 +0000 (15:54 +0000)
* src/pic16/device.h,
* src/pic16/glue.c,
* src/pic16/main.c: enable --optimize-goto by default

* device/lib/pic16/Makefile.common.in: suppress removed option

* src/pic16/gen.c,
* src/pic16/genutils.c: avoid too long relative branches (#2031890)

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5204 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
device/lib/pic16/Makefile.common.in
doc/sdccman.lyx
src/pic16/device.h
src/pic16/gen.c
src/pic16/genutils.c
src/pic16/glue.c
src/pic16/main.c

index a260ce27e835a80ca29216a027ce0efa45637f94..069ab8edca6d6a399f5daa107f623c5784ef88c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,18 @@
+2008-08-04 Raphael Neider <rneider AT web.de>
+
+       * doc/sdccman.lyx,
+       * src/pic16/device.h,
+       * src/pic16/glue.c,
+       * src/pic16/main.c: enable --optimize-goto by default
+
+       * device/lib/pic16/Makefile.common.in: suppress removed option
+
+       * src/pic16/gen.c,
+       * src/pic16/genutils.c: avoid too long relative branches (#2031890)
+
 2008-07-30 Borut Razem <borut.razem AT siol.net>
 
-       * src\pic16\device.c, src\pic16\glue.c, src\pic16\pcode.c:
+       * src/pic16/device.c, src/pic16/glue.c, src/pic16/pcode.c:
          applied patch 22032433: PIC16: fix constant strings,
          thanks Mauro Giachero
 
@@ -18,7 +30,7 @@
 2008-07-12 Philipp Klaus Krause <pkk AT spth.de>
        * src/z80/mappings.i: Implemented RFE #1919415
        * src/z80/peeph-z80.def: Implemented RFE #1919415, #1861376,
-          #1880202, #1914434, prepared for RFE #1703943
+         #1880202, #1914434, prepared for RFE #1703943
 
 2008-07-12 Philipp Klaus Krause <pkk AT spth.de>
 
index a5ac1c1af0646e16404de9f6aa5de20de152077b..27a29a1637b1764cf0a44b88215e410e98ae5e40 100644 (file)
@@ -38,7 +38,7 @@ CFLAGS += -Wa,-q
 CFLAGS += --fommit-frame-pointer
 CFLAGS += --obanksel=9
 CFLAGS += --denable-peeps
-CFLAGS += --optimize-goto
+#CFLAGS += --no-optimize-goto
 CFLAGS += --optimize-cmp
 CFLAGS += --optimize-df
 
index 0abeacc6ba1ceb4c5b3c9e5f71f81d81cb702557..746bb8be33b933605498404d48b588beb09019b0 100644 (file)
@@ -24787,7 +24787,7 @@ status collapsed
 
 \end_inset
 
--optimize-goto Try to use (conditional) BRA instead of GOTO.
+-no-optimize-goto Do not use (conditional) BRA instead of GOTO.
 \end_layout
 
 \begin_layout Description
index 0bda0f118f8e8cc39ca411c4577c064178fb20f9..c3dbd623b848f0a36713ca2bd160608aba197528 100644 (file)
@@ -76,7 +76,7 @@ extern PIC16_device *pic16;
 #define REG_ADDR(r)        ((r)->isBitField ? (((r)->address)>>3) : (r)->address)
 
 #define OF_LR_SUPPORT          0x00000001
-#define OF_OPTIMIZE_GOTO       0x00000002
+#define OF_NO_OPTIMIZE_GOTO    0x00000002
 #define OF_OPTIMIZE_CMP                0x00000004
 #define OF_OPTIMIZE_DF         0x00000008
 
index 062810bca1186837a7f9021d31aa966b27fd1d80..46f7b482c65561e005473421f457efe59a3f00d1 100644 (file)
@@ -5471,7 +5471,7 @@ static void genAnd (iCode *ic, iCode *ifx)
                   if (nonnull)
                     {
                       pic16_emitpcode (POC_BTFSC, pic16_newpCodeOpBit(pic16_aopGet (AOP (left), offset, FALSE, FALSE), posbit - 1, 0, PO_GPR_REGISTER));
-                      pic16_emitpcode (POC_BRA, pic16_popGetLabel (rIfx.condition ? rIfx.lbl->key : tlbl->key));
+                      pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.condition ? rIfx.lbl->key : tlbl->key));
                     }
                   else
                     {
@@ -5496,7 +5496,7 @@ static void genAnd (iCode *ic, iCode *ifx)
                       if (rIfx.condition)
                         {
                           emitSKPZ;
-                          pic16_emitpcode (POC_BRA, pic16_popGetLabel (rIfx.lbl->key)); /* to false */
+                          pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.lbl->key)); /* to false */
                         }
                       else
                         {
@@ -5528,7 +5528,7 @@ static void genAnd (iCode *ic, iCode *ifx)
           if (ifx)
             {
               if (emitBra)
-                pic16_emitpcode (POC_BRA, pic16_popGetLabel (rIfx.lbl->key));
+                pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.lbl->key));
               ifx->generated = 1;
             }
           pic16_emitpLabel (tlbl->key);
@@ -5812,7 +5812,7 @@ static void genOr (iCode *ic, iCode *ifx)
       if (lit)
         {
           if (rIfx.condition)
-            pic16_emitpcode (POC_BRA, pic16_popGetLabel (rIfx.lbl->key)); /* to false */
+            pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.lbl->key)); /* to false */
           ifx->generated = 1;
         }
       else
@@ -6092,7 +6092,7 @@ static void genXor (iCode *ic, iCode *ifx)
                 {
                   /* rIfx.lbl might be far away... */
                   emitSKPZ;
-                  pic16_emitpcode (POC_BRA, pic16_popGetLabel (rIfx.lbl->key)); /* to false */
+                  pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.lbl->key)); /* to false */
                 }
               else
                 {
@@ -6120,7 +6120,7 @@ static void genXor (iCode *ic, iCode *ifx)
         {
           if (ifx)
             {
-              pic16_emitpcode (POC_BRA, pic16_popGetLabel (rIfx.lbl->key));
+              pic16_emitpcode (POC_GOTO, pic16_popGetLabel (rIfx.lbl->key));
               ifx->generated = 1;
             }
           pic16_emitpLabel (tlbl->key);
index f36b7ab48b9c7cf4242c4adb682103449b1806bc..c4743a581232c71f502e5b336f800cda039a09e9 100644 (file)
@@ -607,7 +607,7 @@ int pic16_genCmp_special(operand *left, operand *right, operand *result,
                 tmplbl = newiTempLabel( NULL );
                 pic16_emitpcode(POC_TSTFSZ, pic16_popGet(AOP(left), 0));
                 pic16_emitpcode(POC_BRA, pic16_popGetLabel(tmplbl->key));
-                pic16_emitpcode(POC_BRA, pic16_popGetLabel(rIfx->lbl->key));
+                pic16_emitpcode(POC_GOTO, pic16_popGetLabel(rIfx->lbl->key));
                 pic16_emitpLabel(tmplbl->key);
 
                 ifx->generated = 1;
index 0b1096b9b0a4b8cf334a48bcf51faf6faffd8489..da95d2e016d9a42478a9a0c6e0a85212202649be 100644 (file)
@@ -1850,7 +1850,7 @@ pic16glue ()
     }
 
     /* turn GOTOs into BRAs -- added by RN 2004-11-16 */
-    if(pic16_options.opt_flags & OF_OPTIMIZE_GOTO) {
+    if(!(pic16_options.opt_flags & OF_NO_OPTIMIZE_GOTO)) {
       pic16_OptimizeJumps();
     }
 
index 648f64e4212c2d1a3cdbacd16df218f197eafd17..3ca6844ec8104854ae8509fdd7610d022e5b3f27 100644 (file)
@@ -503,9 +503,9 @@ _process_pragma(const char *s)
 
 #define OFMSG_LRSUPPORT "--flr-support"
 
-#define OPTIMIZE_GOTO   "--optimize-goto"
-#define OPTIMIZE_CMP    "--optimize-cmp"
-#define OPTIMIZE_DF     "--optimize-df"
+#define NO_OPTIMIZE_GOTO    "--no-optimize-goto"
+#define OPTIMIZE_CMP        "--optimize-cmp"
+#define OPTIMIZE_DF         "--optimize-df"
 
 char *alt_asm=NULL;
 char *alt_link=NULL;
@@ -528,7 +528,7 @@ OPTION pic16_optionsTable[]= {
     /* optimization options */
     { 0, OPT_BANKSEL,       &pic16_options.opt_banksel, "set banksel optimization level (default=0 no)", CLAT_INTEGER },
     { 0, "--denable-peeps", &pic16_enable_peeps, "explicit enable of peepholes"},
-    { 0, OPTIMIZE_GOTO,     NULL, "try to use (conditional) BRA instead of GOTO"},
+    { 0, NO_OPTIMIZE_GOTO,  NULL, "do NOT use (conditional) BRA instead of GOTO"},
     { 0, OPTIMIZE_CMP,      NULL, "try to optimize some compares"},
     { 0, OPTIMIZE_DF,       NULL, "thoroughly analyze data flow (memory and time intensive!)"},
 
@@ -606,8 +606,8 @@ _pic16_parseOptions (int *pargc, char **argv, int *i)
     }
 #endif
 
-    if (ISOPT(OPTIMIZE_GOTO)) {
-      pic16_options.opt_flags |= OF_OPTIMIZE_GOTO;
+    if (ISOPT(NO_OPTIMIZE_GOTO)) {
+      pic16_options.opt_flags |= OF_NO_OPTIMIZE_GOTO;
       return TRUE;
     }