Get top working with the PowerPC; use it to eliminate useless branches and

moves.
This commit is contained in:
David Given 2016-10-29 23:37:11 +02:00
parent a8c4dac67c
commit 8c3670483f
5 changed files with 34 additions and 14 deletions

View file

@ -1,4 +1,9 @@
for _, plat in ipairs(vars.plats) do for _, plat in ipairs(vars.plats) do
acklibrary {
name = "headers_"..plat,
hdrs = { "./*.h" }
}
acklibrary { acklibrary {
name = "lib_"..plat, name = "lib_"..plat,
srcs = { srcs = {
@ -6,7 +11,8 @@ for _, plat in ipairs(vars.plats) do
}, },
vars = { plat = plat }, vars = { plat = plat },
deps = { deps = {
"h+emheaders" "h+emheaders",
"+headers_"..plat,
} }
} }
end end

View file

@ -1,7 +1,8 @@
/* 68020 desciptor table for ACK target optimizer */ /* PowerPC desciptor table for ACK target optimizer */
MAXOP 3; MAXOP 3;
LABEL_STARTER '.';
%%; %%;
@ -15,6 +16,14 @@ X, Y, Z { TRUE };
addi X, X, 0 -> ; addi X, X, 0 -> ;
addis X, X, 0 -> ; addis X, X, 0 -> ;
mr X, X -> ;
fmr X, X -> ;
or X, Y, Z : or. X, X, X -> or. X, Y, Z ; or X, Y, Z : or. X, X, X -> or. X, Y, Z ;
b X : labdef X -> labdef X ;
/* IFFALSE=4, IFTRUE=12, ALWAYS=20 */
/* LT=0, GT=1, EQ=2, OV=3 */
%%; %%;

View file

@ -51,12 +51,12 @@ static void unknown_type(const char* s)
static const char* ilabel_to_str(label l) static const char* ilabel_to_str(label l)
{ {
assert(current_proc != NULL); assert(current_proc != NULL);
return aprintf("__%s_I%d", current_proc->name, l); return aprintf(".%s_I%d", current_proc->name, l);
} }
static const char* dlabel_to_str(label l) static const char* dlabel_to_str(label l)
{ {
return aprintf("__D%d", l); return aprintf(".D%d", l);
} }
static void terminate_block(void) static void terminate_block(void)

View file

@ -15,12 +15,18 @@ build_ncg {
arch = "powerpc", arch = "powerpc",
} }
build_top {
name = "top",
arch = "powerpc",
}
return installable { return installable {
name = "tools", name = "tools",
map = { map = {
["$(PLATDEP)/linuxppc/as"] = "+as", ["$(PLATDEP)/linuxppc/as"] = "+as",
["$(PLATDEP)/linuxppc/ncg"] = "+ncg", ["$(PLATDEP)/linuxppc/ncg"] = "+ncg",
["$(PLATDEP)/linuxppc/mcg"] = "+mcg", ["$(PLATDEP)/linuxppc/mcg"] = "+mcg",
["$(PLATDEP)/linuxppc/top"] = "+top",
["$(PLATIND)/descr/linuxppc"] = "./descr", ["$(PLATIND)/descr/linuxppc"] = "./descr",
"util/opt+pkg", "util/opt+pkg",
} }

View file

@ -40,16 +40,15 @@ name be
stdout stdout
need .e need .e
end end
# FIXME(dtrg): not working yet name asopt
#name asopt from .s
# from .s to .so
# to .so program {EM}/lib/ack/{PLATFORM}/top
# program {EM}/lib/ack/{PLATFORM}/top args
# args optimizer
# optimizer stdin
# stdin stdout
# stdout end
#end
name as name as
from .s.so from .s.so
to .o to .o