From 9e374461da1807d52abbb32cba66d31f9824ea95 Mon Sep 17 00:00:00 2001 From: vrokas Date: Wed, 15 Sep 2004 00:17:07 +0000 Subject: [PATCH] * src/SDCCicode.c (piCode): applied patch from Raphael Neider, * src/pic16/device.c (pic16_assignConfigWordValues): wrong configuration values no more rejected by compiler, they are assigned to configuration registers with a warning message instead, * src/pic16/glue.c (pic16_emitConfigRegs): added +1 at top-limit of the for-loop so last conf register is emitted too, * (_pic16_initPaths): link library libsdcc.lib by default, * (_hasNativeMulFor): modified test for multiplication according to Raphael Neider's remarks. Integer multiplication is also done with support functions, * device/include/pic16/pic18fregs.h: corrected type error in while testing and including 18f6720 header file git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3496 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 15 +++++++++ device/include/pic16/pic18fregs.h | 2 +- src/SDCCicode.c | 2 +- src/pic16/gen.c | 4 +++ src/pic16/main.c | 51 ++++++++++++++++--------------- 5 files changed, 48 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2a1ebd2..5a2c761f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2004-09-15 Vangelis Rokas + + * src/SDCCicode.c (piCode): applied patch from Raphael Neider, + * src/pic16/device.c (pic16_assignConfigWordValues): wrong + configuration values no more rejected by compiler, they are assigned + to configuration registers with a warning message instead, + * src/pic16/glue.c (pic16_emitConfigRegs): added +1 at top-limit of + the for-loop so last conf register is emitted too, + * (_pic16_initPaths): link library libsdcc.lib by default, + * (_hasNativeMulFor): modified test for multiplication according to + Raphael Neider's remarks. Integer multiplication is also done with + support functions, + * device/include/pic16/pic18fregs.h: corrected type error in while + testing and including 18f6720 header file + 2004-09-14 Vangelis Rokas * src/pic16/device.h (pic16_options): removed field use_crt, diff --git a/device/include/pic16/pic18fregs.h b/device/include/pic16/pic18fregs.h index 9cf4a1f1..717ecb5f 100644 --- a/device/include/pic16/pic18fregs.h +++ b/device/include/pic16/pic18fregs.h @@ -56,7 +56,7 @@ # include #elif defined(pic18f6720) -# include +# include #elif defined(pic18f8520) # include diff --git a/src/SDCCicode.c b/src/SDCCicode.c index 01bf6e6c..6c217d45 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -514,7 +514,7 @@ piCode (void *item, FILE * of) of = stdout; icTab = getTableEntry (ic->op); - fprintf (stdout, "%s(%d:%d:%d:%d:%d)\t", + fprintf (of, "%s(%d:%d:%d:%d:%d)\t", ic->filename, ic->lineno, ic->seq, ic->key, ic->depth, ic->supportRtn); icTab->iCodePrint (of, ic, icTab->printName); diff --git a/src/pic16/gen.c b/src/pic16/gen.c index 1d4021ff..6ec83ba7 100644 --- a/src/pic16/gen.c +++ b/src/pic16/gen.c @@ -1122,10 +1122,13 @@ void pic16_aopOp (operand *op, iCode *ic, bool result) /* force a new aop if sizes differ */ sym->usl.spillLoc->aop = NULL; } + +#if 0 DEBUGpic16_emitcode(";","%s %d %s sym->rname = %s, offset %d", __FUNCTION__,__LINE__, sym->usl.spillLoc->rname, sym->rname, sym->usl.spillLoc->offset); +#endif sym->aop = op->aop = aop = newAsmop(AOP_PCODE); //aop->aopu.pcop = pic16_popGetImmd(sym->usl.spillLoc->rname,0,sym->usl.spillLoc->offset); @@ -6618,6 +6621,7 @@ static void genAnd (iCode *ic, iCode *ifx) (posbit-1),0, PO_GPR_REGISTER)); pic16_emitpcode(POC_BRA, pic16_popGetLabel(tlbl->key)); +// pic16_emitpcode(POC_BRA, pic16_popGetLabel(rIfx.lbl->key)); } else { if (bytelit == 0xff) { /* Aaron had a MOVF instruction here, changed to MOVFW cause diff --git a/src/pic16/main.c b/src/pic16/main.c index dcea7acb..c62ea9dd 100644 --- a/src/pic16/main.c +++ b/src/pic16/main.c @@ -420,29 +420,32 @@ static void _pic16_initPaths(void) set *pic16libDirsSet; char devlib[512]; - setMainValue("mcu", pic16->name[2] ); - addSet(&preArgvSet, Safe_strdup("-D{mcu}")); + setMainValue("mcu", pic16->name[2] ); + addSet(&preArgvSet, Safe_strdup("-D{mcu}")); - sprintf(pic16incDir, "%s%cpic16", INCLUDE_DIR_SUFFIX, DIR_SEPARATOR_CHAR); - sprintf(pic16libDir, "%s%cpic16", LIB_DIR_SUFFIX, DIR_SEPARATOR_CHAR); + sprintf(pic16incDir, "%s%cpic16", INCLUDE_DIR_SUFFIX, DIR_SEPARATOR_CHAR); + sprintf(pic16libDir, "%s%cpic16", LIB_DIR_SUFFIX, DIR_SEPARATOR_CHAR); - if(!options.nostdinc) { - /* setup pic16 include directory */ - pic16incDirsSet = appendStrSet(dataDirsSet, NULL, pic16incDir); - mergeSets(&includeDirsSet, pic16incDirsSet); - } - - if(!options.nostdlib) { - /* setup pic16 library directory */ - pic16libDirsSet = appendStrSet(dataDirsSet, NULL, pic16libDir); - mergeSets(&libDirsSet, pic16libDirsSet); - } - - if(!pic16_options.nodefaultlibs) { - /* now add the library for the device */ - sprintf(devlib, "%s.lib", pic16->name[2]); - addSet(&libFilesSet, Safe_strdup(devlib)); - } + if(!options.nostdinc) { + /* setup pic16 include directory */ + pic16incDirsSet = appendStrSet(dataDirsSet, NULL, pic16incDir); + mergeSets(&includeDirsSet, pic16incDirsSet); + } + + if(!options.nostdlib) { + /* setup pic16 library directory */ + pic16libDirsSet = appendStrSet(dataDirsSet, NULL, pic16libDir); + mergeSets(&libDirsSet, pic16libDirsSet); + } + + if(!pic16_options.nodefaultlibs) { + /* now add the library for the device */ + sprintf(devlib, "%s.lib", pic16->name[2]); + addSet(&libFilesSet, Safe_strdup(devlib)); + + /* add the internal SDCC library */ + addSet(&libFilesSet, Safe_strdup( "libsdcc.lib" )); + } } extern set *linkOptionsSet; @@ -673,13 +676,13 @@ static bool _hasNativeMulFor (iCode *ic, sym_link *left, sym_link *right) #if 1 /* multiplication is fixed */ /* support mul for char/int/long */ - if((getSize(OP_SYMBOL(IC_LEFT(ic))->type ) <= 4) - && (ic->op == '*'))return TRUE; + if((ic->op == '*') + && (getSize(OP_SYMBOL(IC_LEFT(ic))->type ) < 2))return TRUE; #endif #if 0 /* support div for char/int/long */ - if((getSize(OP_SYMBOL(IC_LEFT(ic))->type ) <= 0) + if((getSize(OP_SYMBOL(IC_LEFT(ic))->type ) < 0) && (ic->op == '/'))return TRUE; #endif -- 2.30.2