+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
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
* 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,
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));
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 */
/*-----------------------------------------------------------------*/
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:
pic16_freeAsmop(result,NULL,ic,TRUE);
}
-void pic16_loadFSR0(operand *op)
-{
- pic16_emitpcode(POC_LFSR, pic16_popGetLit2(0, pic16_popGet(AOP(op), 0)));
-}
/*-----------------------------------------------------------------*/
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;
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));
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;
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 *