Received: from eggs.gnu.org ([2001:4830:134:3::10]:38319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx5YM-0003Bg-Q5 for qemu-devel@nongnu.org; Thu, 20 Oct 2016 01:06:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bx5YI-00051k-SQ for qemu-devel@nongnu.org; Thu, 20 Oct 2016 01:06:06 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:36554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bx5YI-00051R-L9 for qemu-devel@nongnu.org; Thu, 20 Oct 2016 01:06:02 -0400 Received: by mail-pf0-x244.google.com with SMTP id r16so4369531pfg.3 for ; Wed, 19 Oct 2016 22:06:02 -0700 (PDT) Sender: Richard Henderson References: <20161018215031.2575-1-marex@denx.de> <20161018215031.2575-2-marex@denx.de> <81223765-c31a-ea21-f35c-9d281b909a72@twiddle.net> <918399ac-6805-17a2-79f7-3615f2683b41@denx.de> <8d98bd42-7c5a-4ce8-8de7-b85ad0c2b4b6@denx.de> From: Richard Henderson Message-ID: <234750ba-d054-ac99-78ac-e41a56a1f6fe@twiddle.net> Date: Wed, 19 Oct 2016 22:05:59 -0700 MIME-Version: 1.0 In-Reply-To: <8d98bd42-7c5a-4ce8-8de7-b85ad0c2b4b6@denx.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V3 2/7] nios2: Add architecture emulation support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marek Vasut , qemu-devel@nongnu.org Cc: Chris Wulff , Jeff Da Silva , Ley Foon Tan , Sandra Loosemore , Yves Vandervennet On 10/19/2016 08:01 PM, Marek Vasut wrote: >> > You might like 0xfffffffc better, but that does require that you count >> > f's appropriately for the type. That's why I like -4: it's obvious (or >> > should be) that it masks to a multiple of 4, and type promotion extends >> > bits to the left as needed for the type of the other AND argument. > But then you can also use ~3 , right ? Yes. > In which case, you'd avoid doing > bitwise operations with negative numbers, which is nice. Eh. Since ~3 == -4, ~3 is a negative number. So it's a false argument. (C triviallities aside, such as the fact that there are no negative constants, only positive constants to which unary negation may be applied.) The reason I like -4 is that it aligns to 4, spelled the same way. r~