qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Qemu-ppc] Floating point unit bugs


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [Qemu-ppc] Floating point unit bugs
Date: Wed, 21 Jun 2017 13:14:38 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]