From: David Given Date: Thu, 30 Aug 2018 21:50:24 +0000 (+0200) Subject: Merge. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=08a22493704789bb2a5d48c00f5fc6af21f0e1ea;p=ack.git Merge. --- 08a22493704789bb2a5d48c00f5fc6af21f0e1ea diff --cc build.lua index a8e054739,9bce99f90..3b144bf87 --- a/build.lua +++ b/build.lua @@@ -11,14 -12,17 +12,17 @@@ vars.plats = "linuxppc", "osx386", "osxppc", --- --"qemuppc", + "qemuppc", "pc86", "rpi", + "pdpv7", + "em22", } vars.plats_with_tests = { + "linux68k", "linux386", "linuxppc", - "qemuppc", + -- --"qemuppc", "pc86", } diff --cc mach/powerpc/mcg/table index 5de33aec0,ca44ce869..c58f40f35 --- a/mach/powerpc/mcg/table +++ b/mach/powerpc/mcg/table @@@ -288,8 -309,10 +291,11 @@@ PATTERN emit "lwz %out, %addr" cost 4; + #if 0 + /* FIXME: Doesn't work because %out.0 and %addr might share a + * register, so it corrupts %addr before it loads %out.1. */ out:(long)reg = LOAD.L(addr:address) + with corrupted(%addr) emit "lwz %out.0, 4+%addr" emit "lwz %out.1, 0+%addr" cost 8; diff --cc mach/proto/mcg/treebuilder.c index 7a7b8d55b,ac811fc14..d9ded4cb8 --- a/mach/proto/mcg/treebuilder.c +++ b/mach/proto/mcg/treebuilder.c @@@ -1449,100 -1505,27 +1505,29 @@@ static void insn_ivalue(int opcode, ari } case op_blm: - { - /* Input stack: ( src dest -- ) */ - struct ir* dest = pop(EM_pointersize); - struct ir* src = pop(EM_pointersize); - blockmove(dest, src, new_wordir(value)); + push(new_wordir(value)); + helper_function(".bls4"); break; - } case op_bls: - { - /* Input stack: ( src dest size -- ) */ - struct ir* dest = pop(EM_pointersize); - struct ir* src = pop(EM_pointersize); - struct ir* size = pop(EM_wordsize); - blockmove(dest, src, size); + if (value != EM_wordsize) + fatal("'bls %d' not supported", value); + helper_function(".bls4"); break; + } case op_los: - { - /* Copy an arbitrary amount to the stack. */ - struct ir* bytes = pop(EM_wordsize); - struct ir* address = pop(EM_pointersize); - - materialise_stack(); - appendir( - new_ir1( - IR_STACKADJUST, EM_pointersize, - new_ir1( - IR_NEG, EM_wordsize, - bytes - ) - ) - ); - - push( - new_ir0( - IR_GETSP, EM_pointersize - ) - ); - push(address); - push(bytes); - materialise_stack(); - appendir( - new_ir1( - IR_CALL, 0, - new_labelir("memcpy") - ) - ); - appendir( - new_ir1( - IR_STACKADJUST, EM_pointersize, - new_wordir(EM_pointersize*2 + EM_wordsize) - ) - ); + if (value != EM_wordsize) + fatal("'los %d' not supported", value); + helper_function_with_arg(".los4", pop(EM_wordsize)); break; + } case op_sts: - { - /* Copy an arbitrary amount from the stack. */ - struct ir* bytes = pop(EM_wordsize); - struct ir* dest = pop(EM_pointersize); - struct ir* src; - - materialise_stack(); - src = appendir( - new_ir0( - IR_GETSP, EM_pointersize - ) - ); - - push(dest); - push(src); - push(bytes); - materialise_stack(); - appendir( - new_ir1( - IR_CALL, 0, - new_labelir("memcpy") - ) - ); - appendir( - new_ir1( - IR_STACKADJUST, EM_pointersize, - new_ir2( - IR_ADD, EM_wordsize, - new_wordir(EM_pointersize*2 + EM_wordsize), - bytes - ) - ) - ); + if (value != EM_wordsize) + fatal("'sts %d' not supported", value); + helper_function_with_arg(".sts4", pop(EM_wordsize)); break; - } case op_lin: {