From: spth Date: Fri, 26 Dec 2008 13:54:16 +0000 (+0000) Subject: Implemented RFE #1914254 X-Git-Url: https://git.gag.com/?p=fw%2Fsdcc;a=commitdiff_plain;h=3dc8038c8b8b8affcac918268cef56b923829525 Implemented RFE #1914254 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5301 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index d53ff388..56ad49ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-12-26 Philipp Klaus Krause + * src/z80/main.c, + src/z80/gen.c, + device/include/string.h: Implemented RFE #1914254 + 2008-12-26 Philipp Klaus Krause * device/lib/z80/Makefile.in, device/lib/Makefile.in, diff --git a/device/include/string.h b/device/include/string.h index fd55d0ad..4ab59815 100644 --- a/device/include/string.h +++ b/device/include/string.h @@ -50,6 +50,9 @@ extern char *strstr (char *, char *) ; extern int strlen (char * ) ; extern char *strtok (char *, char *) ; extern void *memcpy (void *, void *, size_t ) ; +#ifdef SDCC_z80 +#define memcpy(dst, src, n) __builtin_memcpy(dst, src, n) +#endif extern int memcmp (void *, void *, size_t ) ; extern void *memset (void *, unsigned char , size_t ) ; extern void *memmove (void *, void *, size_t ) ; diff --git a/src/z80/gen.c b/src/z80/gen.c index d055c7a1..eac67d7b 100644 --- a/src/z80/gen.c +++ b/src/z80/gen.c @@ -8196,7 +8196,7 @@ genBuiltInMemcpy (iCode *ic, int nParams, operand **pparams) operand *from, *to, *count; bool deInUse; - wassertl (nParams == 3, "Built-in memcpy must have two parameters"); + wassertl (nParams == 3, "Built-in memcpy must have three parameters"); to = pparams[2]; from = pparams[1]; count = pparams[0]; diff --git a/src/z80/main.c b/src/z80/main.c index 2f94e361..dbb465df 100644 --- a/src/z80/main.c +++ b/src/z80/main.c @@ -113,9 +113,8 @@ extern PORT z80_port; static builtins _z80_builtins[] = { /* Disabled for now. - { "__builtin_strcpy", "v", 2, {"cg*", "cg*" } }, - { "__builtin_memcpy", "cg*", 3, {"cg*", "cg*", "ui" } }, - */ + { "__builtin_strcpy", "v", 2, {"cg*", "cg*" } },*/ + { "__builtin_memcpy", "vg*", 3, {"vg*", "vg*", "ui" } }, { NULL , NULL,0, {NULL}} }; @@ -827,7 +826,7 @@ PORT z80_port = 0, /* leave == */ TRUE, /* Array initializer support. */ 0, /* no CSE cost estimation yet */ - _z80_builtins, /* no builtin functions */ + _z80_builtins, /* builtin functions */ GPOINTER, /* treat unqualified pointers as "generic" pointers */ 1, /* reset labelKey to 1 */ 1, /* globals & local static allowed */