From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9I49-0006mS-6S for qemu-devel@nongnu.org; Thu, 29 Sep 2011 10:58:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9I43-0003Zf-Dz for qemu-devel@nongnu.org; Thu, 29 Sep 2011 10:58:25 -0400 Received: from mail-ww0-f53.google.com ([74.125.82.53]:39130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9I43-0003ZE-8X for qemu-devel@nongnu.org; Thu, 29 Sep 2011 10:58:19 -0400 Received: by wwg14 with SMTP id 14so1034025wwg.10 for ; Thu, 29 Sep 2011 07:58:17 -0700 (PDT) Sender: Richard Henderson Message-ID: <4E848785.6090604@twiddle.net> Date: Thu, 29 Sep 2011 07:58:13 -0700 From: Richard Henderson MIME-Version: 1.0 References: <4E8312D7.4080403@siemens.com> <4E832E88.6080909@twiddle.net> <4E83304F.4010008@siemens.com> <4E833AEA.8080508@twiddle.net> <4E839A88.4060003@web.de> <4E83A3F7.3000508@twiddle.net> <4E84570F.3040103@siemens.com> In-Reply-To: <4E84570F.3040103@siemens.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] tcg-i386: Introduce limited deposit support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Blue Swirl , qemu-devel , Aurelien Jarno On 09/29/2011 04:31 AM, Jan Kiszka wrote: > x86 cannot provide an optimized generic deposit implementation. But at > least for a few special cases, namely for writing bits 0..7, 8..15, and > 0..15, versions using only a single instruction are feasible. > Introducing such limited support improves emulating 16-bit x86 code on > x86, but also rarer cases where 32-bit or 64-bit code accesses bytes or > words. > > Signed-off-by: Jan Kiszka > --- > > Changes in v2: > - introduce restricting predicates TCG_TARGET_deposit_i32/64_valid > to decide if deposit support can be used > - express register constraints via new 'Q' symbol That's what I had in mind, yes. The only thing that's missing now is a default version of > +#define TCG_TARGET_deposit_i32_valid(ofs, len) \ > + (((ofs) == 0 && (len) == 8) || ((ofs) == 8 && (len) == 8) || \ > + ((ofs) == 0 && (len) == 16)) > +#define TCG_TARGET_deposit_i64_valid TCG_TARGET_deposit_i32_valid These. r~