|
From: Julian S. <js...@ac...> - 2013-07-10 11:41:37
|
Hi s390ers and mipsers, I've been working on a comprehensive fix for https://bugs.kde.org/show_bug.cgi?id=294285 (deal properly with partially-valid 128- and 256-bit vector loads). The core of the problem is that the calls to dirty helper functions that Memcheck generates need to be able to return 16-byte values, and probably in the future 32 byte values. To do this I added the ability of helper functions to return a V128 or V256 by reference. The helper function can declare a V128*/V256* parameter, which it is assumed to put the result in. At the IR level the position of the out parameter is marked by a special value in the argument list (IRExprP__VECRET), but apart from that there's no change at the IR level. The back ends have to be modified to allocate space on the stack when they see such a value, pass the address to the callee, and read the value back out after the call. Passing of the baseblock pointer is now done similarly (IRExprP__BBPTR) and IRDirty.needsBBP is gone. This scheme is probably lower performance than using ABI-specific struct-return conventions, since it goes via memory, but it's simpler and avoids exposure to potential struct-return bugs in gcc -- since it requires no cooperation at all from gcc. Also, in the big picture, this allows replacing two calls to MC_(helperc_LOADV64) with a single call to MC_(helperc_LOADV128) so that should more than compensate for passing the value through memory. Anyway: I have modified the amd64, x86 and ARM back ends to deal with this, and I will do the ppc32 and ppc64 back ends later this week. I could probably do the mips32/64 cases if I could find a working gcc-compile-farm MIPS machine, which I can't. But I can't do the s390 back end. So .. can I enlist your help with this? Because (AFAIK) neither the s390 nor mips back ends deal with vectors, this should be pretty straightforward. It is essentially a change to how doHelperCall in host_xxx_isel.c is called. No change in the generated code. Thanks, J |