Received: from eggs.gnu.org ([2001:4830:134:3::10]:38128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d85fM-0007UG-MC for qemu-devel@nongnu.org; Tue, 09 May 2017 09:59:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d85fL-0004cZ-M9 for qemu-devel@nongnu.org; Tue, 09 May 2017 09:59:04 -0400 In-Reply-To: References: <0F376E9C-2D4B-4D79-B3D4-24F73FD61446@gmail.com> <20170508221304.y36owezwla7sc6ss@aurel32.net> <20170508225007.2duqxlo5ab2aenpl@aurel32.net> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: G 3 Date: Tue, 9 May 2017 09:58:56 -0400 Subject: Re: [Qemu-devel] [Qemu-ppc] Floating point unit bugs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: BALATON Zoltan Cc: Aurelien Jarno , "qemu-ppc@nongnu.org list:PowerPC" , "qemu-devel@nongnu.org qemu-devel" On May 9, 2017, at 5:55 AM, BALATON Zoltan wrote: > On Tue, 9 May 2017, Aurelien Jarno wrote: >> | main.c: In function 'print_fpscr_settings': >> | main.c:73:26: warning: suggest parentheses around comparison in >> operand of '&' [-Wparentheses] >> | if ((fpscr >> i) & 0x1 == 1) { >> | ^ > > Actually the compiler is correct here, this should be: > > if ((fpscr >> i & 0x1) == 1) { > > or even just > > if (fpscr >> i & 1) { > > because & is lower priority than == but the result may still be the > same by chance if 0x1 == 1 is always 1 and ANDing the shifted value > with this is either 0 or 1 so it may give the correct result but > not the way one would think looking at the expression. I changed it to this: if (((fpscr >> i) & 0x1) == 1) Thank you.