All of lore.kernel.org
 help / color / mirror / Atom feed
From: BALATON Zoltan <balaton@eik.bme.hu>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: G 3 <programmingkidx@gmail.com>,
	"qemu-ppc@nongnu.org list:PowerPC" <qemu-ppc@nongnu.org>,
	"qemu-devel@nongnu.org qemu-devel" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-ppc]  Floating point unit bugs
Date: Tue, 9 May 2017 11:55:36 +0200 (CEST)	[thread overview]
Message-ID: <alpine.BSF.2.20.1705091148560.78100@zero.eik.bme.hu> (raw)
In-Reply-To: <20170508225007.2duqxlo5ab2aenpl@aurel32.net>

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.

Regards,
BALATON Zoltan

  reply	other threads:[~2017-05-09  9:55 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       ` BALATON Zoltan [this message]
2017-05-09 13:58         ` [Qemu-devel] [Qemu-ppc] " G 3
2017-06-21 16:14           ` Philippe Mathieu-Daudé
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=alpine.BSF.2.20.1705091148560.78100@zero.eik.bme.hu \
    --to=balaton@eik.bme.hu \
    --cc=aurelien@aurel32.net \
    --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.