From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNiHF-0008Cu-Pu for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:14:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNiHC-0000bf-W1 for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:14:45 -0400 Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= References: <0F376E9C-2D4B-4D79-B3D4-24F73FD61446@gmail.com> <20170508221304.y36owezwla7sc6ss@aurel32.net> <20170508225007.2duqxlo5ab2aenpl@aurel32.net> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Wed, 21 Jun 2017 13:14:38 -0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] Floating point unit bugs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: G 3 , BALATON Zoltan Cc: "qemu-ppc@nongnu.org list:PowerPC" , "qemu-devel@nongnu.org qemu-devel" , Aurelien Jarno Hi John, On 05/09/2017 10:58 AM, G 3 wrote: > > 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. do you think you can add your test as a qtest, to run it with check-qtest? Regards, Phil. >