]> git.gag.com Git - fw/sdcc/commitdiff
* src/pic16/device.h (pic16_options): removed field use_crt,
authorvrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 13 Sep 2004 21:48:14 +0000 (21:48 +0000)
committervrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 13 Sep 2004 21:48:14 +0000 (21:48 +0000)
* src/pic16/gen.c (genUnpackBits): added call to pic16_loadFSR0
until an optimization to handle single bits is added,
* (pic16_loadFSR0): moved before genUnpackBits,
* (genAnd): some white lines removed,
* src/pic16/main.c (_pic16_finaliseOptions): set omit_ivt and clear
leave_reset flags in pic16_options when using crt modules,

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

ChangeLog
src/pic16/device.h
src/pic16/gen.c
src/pic16/main.c

index 73ebdecdb8a5716fcbe133a379b625e46405bdc5..d2a1ebd2d96ab1379479aa12c84bef2d07383133 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-09-14 Vangelis Rokas <vrokas AT otenet.gr>
+
+       * src/pic16/device.h (pic16_options): removed field use_crt,
+       * src/pic16/gen.c (genUnpackBits): added call to pic16_loadFSR0
+       until an optimization to handle single bits is added,
+       * (pic16_loadFSR0): moved before genUnpackBits,
+       * (genAnd): some white lines removed,
+       * src/pic16/main.c (_pic16_finaliseOptions): set omit_ivt and clear
+       leave_reset flags in pic16_options when using crt modules,
+
 2004-09-12 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * src/mcs51/ralloc.c (packRegisters): applied fix by Bernhard Held
@@ -20,7 +30,7 @@
        linker command line except than when --no-crt is specified,
        * src/pic16/pcode.c,
        * src/pic16/pcode.h: added some structures and functions for a new
-       optimization scheme to compansete for instruction overhead between
+       optimization scheme to compansate for instruction overhead between
        same iCodes, this scheme is currently under development and is not
        working in any way,
        * src/pic16/gen.c (genAnd): added patch provided by Aaron Collwell
@@ -29,7 +39,6 @@
        * device/lib/pic16/startup/crt0iz.c: added global char variable
        __uflags to force the generation of an idata section
 
-
 2004-09-12 Bernhard Held <bernhard AT bernhardheld.de>
 
        * doc/Makefile,
index 468e1823d76f686066564b2837a86d22d6558a83..0b378b991781d9bc2348b804e88130d6f0276641 100644 (file)
@@ -100,7 +100,6 @@ typedef struct {
        int ivt_loc;
        int nodefaultlibs;
        int dumpcalltree;
-       int use_crt;
        char *crt_name;
        int no_crt;
 } pic16_options_t;
index 2a1b26c86171adc34210cb8611f7086d76e086e5..1d4021ffa20c56194ec35d41b4f261f46dd6ca9b 100644 (file)
@@ -6605,21 +6605,16 @@ static void genAnd (iCode *ic, iCode *ifx)
       symbol *tlbl = newiTempLabel(NULL);
       int sizel = AOP_SIZE(left);
 
-      /* here to add patch from Aaron */
       if(size)
-        emitSETC;                      //pic16_emitcode("setb","c");
-
+        emitSETC;
 
       while(sizel--) {
-        if((bytelit = ((lit >> (offset*8)) & 0x0FFL)) != 0x0L){
-
+        if((bytelit = ((lit >> (offset*8)) & 0x0FFL)) != 0x0L) {
 
           /* patch provided by Aaron Colwell */
           if((posbit = isLiteralBit(bytelit)) != 0) {
               pic16_emitpcode(((rIfx.condition) ? POC_BTFSS : POC_BTFSC ),
-                              pic16_newpCodeOpBit(pic16_aopGet(AOP(left),
-                                                offset,FALSE,
-                                                FALSE),
+                              pic16_newpCodeOpBit(pic16_aopGet(AOP(left), offset,FALSE,FALSE),
                                                 (posbit-1),0, PO_GPR_REGISTER));
 
               pic16_emitpcode(POC_BRA, pic16_popGetLabel(tlbl->key));
@@ -9219,6 +9214,12 @@ release:
     pic16_freeAsmop(result,NULL,ic,TRUE);
 }
 
+
+void pic16_loadFSR0(operand *op)
+{
+       pic16_emitpcode(POC_LFSR, pic16_popGetLit2(0, pic16_popGet(AOP(op), 0)));
+}
+
 /*-----------------------------------------------------------------*/
 /* genUnpackBits - generates code for unpacking bits               */
 /*-----------------------------------------------------------------*/
@@ -9232,6 +9233,11 @@ static void genUnpackBits (operand *result, operand *left, char *rname, int ptyp
        DEBUGpic16_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
        etype = getSpec(operandType(result));
 
+        /* the following call to pic16_loadFSR0 is temporary until
+         * optimization to handle single bit assignments is added
+         * to the function. Until then use the old safe way! -- VR */
+        pic16_loadFSR0( left );
        /* read the first byte  */
        switch (ptype) {
                case POINTER:
@@ -9407,10 +9413,6 @@ release:
     pic16_freeAsmop(result,NULL,ic,TRUE);
 }
 
-void pic16_loadFSR0(operand *op)
-{
-       pic16_emitpcode(POC_LFSR, pic16_popGetLit2(0, pic16_popGet(AOP(op), 0)));
-}
 
 
 /*-----------------------------------------------------------------*/
index 413a5f438dc6759b0cefd21a45075d103d8430bf..8f667fb5f2fd195a50d48b8beca16ae29e409151 100644 (file)
@@ -407,9 +407,8 @@ _pic16_parseOptions (int *pargc, char **argv, int *i)
         if(ISOPT(USE_CRT)) {
           char *tmp;
         
-            tmp = Safe_strdup( getStringArg(USE_CRT, argv, i, *pargc) );
-            pic16_options.use_crt = 1; pic16_options.no_crt = 0;
-            pic16_options.crt_name = tmp;
+            pic16_options.no_crt = 0;
+            pic16_options.crt_name = Safe_strdup( getStringArg(USE_CRT, argv, i, *pargc) );
         }
         
   return FALSE;
@@ -482,12 +481,12 @@ static void _pic16_linkEdit(void)
 
        if(fullSrcFileName) {
                sprintf(temp, "%s.o", dstFileName);
-//             shash_add(&linkValues, "srcofile", temp);
-               addSetHead(&relFilesSet, temp);
+               addSetHead(&relFilesSet, Safe_strdup(temp));
        }
 
-       if(pic16_options.use_crt && !pic16_options.no_crt)
-           shash_add(&linkValues, "spec_ofiles", pic16_options.crt_name);      //"crt0i.o");
+       if(!pic16_options.no_crt)
+          shash_add(&linkValues, "spec_ofiles", pic16_options.crt_name);
+
        shash_add(&linkValues, "ofiles", joinStrSet(relFilesSet));
        shash_add(&linkValues, "libs", joinStrSet(libFilesSet));
        
@@ -509,55 +508,35 @@ extern const char *pic16_asmCmd[];
 static void
 _pic16_finaliseOptions (void)
 {
-       port->mem.default_local_map = data;
-       port->mem.default_globl_map = data;
+    port->mem.default_local_map = data;
+    port->mem.default_globl_map = data;
 
-       /* peepholes are disabled for the time being */
-       options.nopeep = 1;
+    /* peepholes are disabled for the time being */
+    options.nopeep = 1;
 
-       /* explicit enable peepholes for testing */
-       if(pic16_enable_peeps)
-               options.nopeep = 0;
+    /* explicit enable peepholes for testing */
+    if(pic16_enable_peeps)
+      options.nopeep = 0;
 
-       options.all_callee_saves = 1;           // always callee saves
-//     options.float_rent = 1;
-//     options.intlong_rent = 1;
+    options.all_callee_saves = 1;              // always callee saves
+//    options.float_rent = 1;
+//    options.intlong_rent = 1;
        
 
-       if(alt_asm && strlen(alt_asm))
-               pic16_asmCmd[0] = alt_asm;
+    if(alt_asm && strlen(alt_asm))
+      pic16_asmCmd[0] = alt_asm;
        
-       if(alt_link && strlen(alt_link))
-               pic16_linkCmd[0] = alt_link;
+    if(alt_link && strlen(alt_link))
+      pic16_linkCmd[0] = alt_link;
+        
+    if(!pic16_options.no_crt) {
+      pic16_options.omit_ivt = 1;
+      pic16_options.leave_reset = 0;
+    }
 }
 
 
-/* all the rest is commented ifdef'd out */
 #if 0
-  /* Hack-o-matic: if we are using the flat24 model,
-   * adjust pointer sizes.
-   */
-  if (options.model == MODEL_FLAT24)
-    {
-
-      fprintf (stderr, "*** WARNING: you should use the '-mds390' option "
-              "for DS80C390 support. This code generator is "
-              "badly out of date and probably broken.\n");
-
-      port->s.fptr_size = 3;
-      port->s.gptr_size = 4;
-      port->stack.isr_overhead++;      /* Will save dpx on ISR entry. */
-#if 1
-      port->stack.call_overhead++;     /* This acounts for the extra byte 
-                                        * of return addres on the stack.
-                                        * but is ugly. There must be a 
-                                        * better way.
-                                        */
-#endif
-      fReturn = fReturn390;
-      fReturnSize = 5;
-    }
-
   if (options.model == MODEL_LARGE)
     {
       port->mem.default_local_map = xdata;
@@ -606,9 +585,8 @@ _pic16_setDefaultOptions (void)
        pic16_options.ivt_loc = 0x000000;
        pic16_options.nodefaultlibs = 0;
        pic16_options.dumpcalltree = 0;
-       pic16_options.use_crt = 1;
-       pic16_options.crt_name = "crt0i";               /* the default crt to link */
-       pic16_options.no_crt = 0;
+       pic16_options.crt_name = "crt0i.o";             /* the default crt to link */
+       pic16_options.no_crt = 0;                       /* use crt by default */
 }
 
 static const char *