From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFWz8-00057g-5V for qemu-devel@nongnu.org; Mon, 17 Feb 2014 17:48:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFWyz-0004f5-Mx for qemu-devel@nongnu.org; Mon, 17 Feb 2014 17:48:22 -0500 Received: from mail-qa0-x22c.google.com ([2607:f8b0:400d:c00::22c]:35353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFWyz-0004ey-Ix for qemu-devel@nongnu.org; Mon, 17 Feb 2014 17:48:13 -0500 Received: by mail-qa0-f44.google.com with SMTP id w5so22700795qac.3 for ; Mon, 17 Feb 2014 14:48:13 -0800 (PST) Sender: Richard Henderson Message-ID: <5302363A.80102@twiddle.net> Date: Mon, 17 Feb 2014 10:18:02 -0600 From: Richard Henderson MIME-Version: 1.0 References: <1391179418-13422-1-git-send-email-rth@twiddle.net> <1391179418-13422-5-git-send-email-rth@twiddle.net> <20140216181205.GA18681@hall.aurel32.net> In-Reply-To: <20140216181205.GA18681@hall.aurel32.net> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/5] tcg/i386: Use ANDN instruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org On 02/16/2014 12:12 PM, Aurelien Jarno wrote: > On Fri, Jan 31, 2014 at 08:43:37AM -0600, Richard Henderson wrote: >> > Note that the optimizer cannot simplify ANDC X,Y,C to AND X,Y,~C >> > so we must handle constants in the implementation of andc. > I do wonder if it actually won't be a better idea to add this > simplification to the optimizer instead of adding it to the backend. > > The best to do that would be to check with tcg_target_const_match to > see if ANDC would accept such a constraint and to convert it to AND > if not. > > The same can probably be done for ORC. > I suppose we could. There are plenty of pairs for which this could apply, even add/sub, though so far we've forced the backend to take care of that. Perhaps if I have time I'll work something up for tcg_reg_alloc_op and see how much savings we can achieve across the backends. That'll tell us if it's worth bothering with. r~