LIB = z80.lib
CC = $(SCC)
AS = $(SAS)
-CFLAGS = -I../include -I.
+CFLAGS = -I../include -I. --dumpall
all: $(LIB) crt0.o
/* Dumb strings stub.
Wanted a quick hack for now - will use the libc version later.
*/
-#if 0
-char *strcpy(char *dest, const char *source)
+char *_strcpy(char *dest, const char *source)
{
- char *ret = dest;
- while (*dest++ = *source++);
- return ret;
+ char *d = dest;
+ const char *s = source;
+ while (*d++ = *s++);
+ return dest;
}
-#endif
-#if 0
-void *memcpy(void *dest, const void *source, int count)
+void *_memcpy(void *dest, const void *source, int count)
{
char *d = dest;
const char *s = source;
return dest;
}
-#endif
-int __strcmp(const char *s1, const char *s2)
+int _strcmp(const char *s1, const char *s2)
{
- int ret = 0;
+ char ret = 0;
while (!(ret = *s1 - *s2) && *s2)
++s1, ++s2;
return 1;
return 0;
}
-
With all working on 20796 158 196C
Slightly better genCmp(signed) 20597 159 195B
Better reg packing, first peephole 20038 163 1873
+ With assign packing 19281 165 1849
Michael Hope <michaelh@earthling.net> 2000
Based on the mcs51 generator - Sandeep Dutta . sandeep.dutta@usa.net (1998)
iCode *dic, *sic;
if (
- !IS_TRUE_SYMOP(IC_RESULT(ic)) ||
- !IS_ITEMP(IC_RIGHT(ic)) ||
+ /* !IS_TRUE_SYMOP(IC_RESULT(ic)) ||*/
+ !IS_ITEMP(IC_RIGHT(ic)) ||
OP_LIVETO(IC_RIGHT(ic)) > ic->seq ||
OP_SYMBOL(IC_RIGHT(ic))->isind)
return 0;
a use of the true symbol in before we find the definition then
we cannot */
for ( dic = ic->prev ; dic ; dic = dic->prev) {
-
/* if there is a function call and this is
a parameter & not my parameter then don't pack it */
if ( (dic->op == CALL || dic->op == PCALL) &&
}
if (SKIP_IC2(dic))
- continue;
+ continue;
-#if 0
if (IS_SYMOP(IC_RESULT(dic)) &&
IC_RESULT(dic)->key == IC_RIGHT(ic)->key) {
- if (POINTER_SET(dic))
- dic = NULL;
break;
}
dic = NULL ;
break;
}
-#endif
}
if (!dic)
the same atleast one of the operands */
if (OP_SYMBOL(IC_RESULT(ic))->onStack ||
OP_SYMBOL(IC_RESULT(ic))->iaccess ) {
-
+
/* the operation has only one symbol
operator then we can pack */
if ((IC_LEFT(dic) && !IS_SYMOP(IC_LEFT(dic))) ||
}
-#if 0
/*-----------------------------------------------------------------*/
/* packRegsForSupport :- reduce some registers for support calls */
/*-----------------------------------------------------------------*/
return change ;
}
-#endif
#define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly)
CC = /home/michaelh/projects/sdcc/bin/sdcc
# -DNOENUM is here to make the results more predictable
-CFLAGS = -mz80 -v
+CFLAGS = -mz80 -v --dumpall
CFLAGS += -DREG= -DNOSTRUCTASSIGN -DNOENUM -DBROKEN_SDCC=0 -DHZ=100
LIBDIR = /home/michaelh/projects/sdcc/device/lib/z80/
LD = link-z80
DPRINTF(("Looping.\n"));
} /* loop "for Run_Index" */
+ _printTStates();
+
printf("Run_Index = %d\n", Run_Index);
runTime = _clock() - runTime;