X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fz80%2Fmain.c;h=adc65c09523d7af462524f90be140ae759f9db78;hb=d08e6df2202ed3f19b681221b502dedb3c6c8a28;hp=86501c99324a05cc6e8bb8c6949f8bbdde0dbe54;hpb=ac2a3bee4ffe024a919c1b360cc888679a45f326;p=fw%2Fsdcc diff --git a/src/z80/main.c b/src/z80/main.c index 86501c99..adc65c09 100644 --- a/src/z80/main.c +++ b/src/z80/main.c @@ -112,11 +112,8 @@ extern PORT z80_port; #include "mappings.i" static builtins _z80_builtins[] = { - /* Disabled for now. - { "__builtin_strcpy", "v", 2, {"cg*", "cg*" } }, - { "__builtin_memcpy", "cg*", 3, {"cg*", "cg*", "ui" } }, - */ - { NULL , NULL,0, {NULL}} + { "__builtin_memcpy", "vg*", 3, {"vg*", "vg*", "ui" } }, + { NULL , NULL, 0, {NULL}} }; static void @@ -652,6 +649,13 @@ _hasNativeMulFor (iCode *ic, sym_link *left, sym_link *right) test = right; val = OP_VALUE (IC_RIGHT (ic)); } + /* 8x8 unsigned multiplication code is shorter than + call overhead for the multiplication routine. */ + else if ( IS_CHAR (right) && IS_UNSIGNED (right) && + IS_CHAR (left) && IS_UNSIGNED(left) && !IS_GB) + { + return TRUE; + } else { return FALSE; @@ -820,7 +824,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 */