From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: G 3 <programmingkidx@gmail.com>, BALATON Zoltan <balaton@eik.bme.hu>
Cc: "qemu-ppc@nongnu.org list:PowerPC" <qemu-ppc@nongnu.org>,
"qemu-devel@nongnu.org qemu-devel" <qemu-devel@nongnu.org>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [Qemu-ppc] Floating point unit bugs
Date: Wed, 21 Jun 2017 13:14:38 -0300 [thread overview]
Message-ID: <f2644920-8eda-e768-adee-71db36ea2fa3@amsat.org> (raw)
In-Reply-To: <F3D7AC88-099F-432D-B46F-97F2A6F7B0E3@gmail.com>
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.
>
next prev parent reply other threads:[~2017-06-21 16:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-07 21:48 [Qemu-devel] Floating point unit bugs G 3
2017-05-08 21:54 ` Aurelien Jarno
2017-05-08 22:09 ` G 3
2017-05-08 22:34 ` Aurelien Jarno
2017-05-08 22:13 ` Aurelien Jarno
2017-05-08 22:36 ` G 3
2017-05-08 22:50 ` Aurelien Jarno
2017-05-09 9:55 ` [Qemu-devel] [Qemu-ppc] " BALATON Zoltan
2017-05-09 13:58 ` G 3
2017-06-21 16:14 ` Philippe Mathieu-Daudé [this message]
2017-06-21 16:20 ` Peter Maydell
2017-06-21 16:27 ` G 3
2017-06-21 16:28 ` Peter Maydell
2017-06-22 2:54 ` G 3
2017-06-22 7:25 ` Peter Maydell
2017-06-22 15:54 ` G 3
2017-06-21 16:43 ` Alex Bennée
2017-06-21 16:29 ` G 3
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f2644920-8eda-e768-adee-71db36ea2fa3@amsat.org \
--to=f4bug@amsat.org \
--cc=aurelien@aurel32.net \
--cc=balaton@eik.bme.hu \
--cc=programmingkidx@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.