From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT1jR-0003wd-GK for qemu-devel@nongnu.org; Fri, 29 Jul 2016 02:57:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bT1jP-0004wF-No for qemu-devel@nongnu.org; Fri, 29 Jul 2016 02:57:16 -0400 Message-ID: <1469775419.5978.275.camel@kernel.crashing.org> From: Benjamin Herrenschmidt Date: Fri, 29 Jul 2016 16:56:59 +1000 In-Reply-To: <1469774541.5978.265.camel@kernel.crashing.org> References: <579ad8bd.8481620a.89e78.f1ce@mx.google.com> <1469774541.5978.265.camel@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 28/32] ppc: Avoid double translation for lvx/lvxl/stvx/stvxl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: David Gibson , qemu-devel , qemu-ppc@nongnu.org On Fri, 2016-07-29 at 16:42 +1000, Benjamin Herrenschmidt wrote: > On Fri, 2016-07-29 at 09:46 +0530, Richard Henderson wrote: > >=20 > > The form of declaration you're using takes care of that.=C2=A0 In ord= er > > to > > not clobber, you have to use DEF_HELPER_FLAGS with *NO_RWG*. >=20 > BTW. Is that stuff (and the various flags here) somewhat documented > anywhere ? :-) More specifically, looking at the flags defined: #define TCG_CALL_NO_READ_GLOBALS=C2=A0=C2=A0=C2=A0=C2=A00x0010 /* Helper does not write globals */ #define TCG_CALL_NO_WRITE_GLOBALS=C2=A0=C2=A0=C2=A00x0020 /* Helper can be safely suppressed if the return value is not used. */ #define TCG_CALL_NO_SIDE_EFFECTS=C2=A0=C2=A0=C2=A0=C2=A00x0040 I assume by "globals" that means things defined with=C2=A0tcg_global_mem_new_i32() correct ? So I can't do something like set=C2=A0TCG_CALL_NO_RWG (nor=C2=A0TCG_CALL_= NO_WG) on something like dcbz because it can take an exception, correct ? Now if a helper doens't access env->gpr/spr/... but instead=C2=A0take everything as in/out arguments and cannot take an exception, we can use these, right ? I notice that sadly, all of the vector ops are helper with full clobbers, because I assume, the "avr" is passed as pointer due to the lack of an int128 type in TCG correct ? Is the only option here to go down the int128 path or would there be a reasonable way to add a mechanism for more fine grained clobbers ? Another reason why I think that might be handy is that a whole lot of helpers basically have full clobbers simply because they update a CR bit (or fscr for FP ops). It would be nice to be able to mark just that clobbered. Maybe by declaring up to a handful of "globals" special, assigning them an index and having a special clobber bits corresponding to them in the flags ? Cheers, Ben.