All of lore.kernel.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Paul Mackerras <paulus@samba.org>
Cc: Olof Johansson <olof@lixom.net>,
	mahuja@us.ibm.com, linasvepstas@gmail.com,
	linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] pseries: phyp dump: Variable size reserve space.
Date: Thu, 10 Apr 2008 05:10:59 +0200	[thread overview]
Message-ID: <3ff8bdda029b9de8bb712012cec39ab3@kernel.crashing.org> (raw)
In-Reply-To: <18429.28416.578860.961632@cargo.ozlabs.ibm.com>

>>>>> +	tmp = tmp & ~0x000000001FFFFFFF;
>>
>> Note that this only works as you expect because the constant is
>> signed here -- the extra zeroes do not magically make it a 64-bit
>> number.  So it goes 32-bit 0x1fffffff -> 32-bit -0x20000000 ->
>> 64-bit -0x20000000.
>
> Huh?  It's not big enough to be negative when considered as a 32-bit
> number...

0x1fffffff isn't, right; and that makes it a signed int.  Applying
the complement operator to it turns it negative.  And then the
implicit cast (because tmp is 64-bit) makes it 64-bit, still the
same negative value.  Which is the expected result, but via a way
too tricky (and fragile) path :-)


Segher

  reply	other threads:[~2008-04-10  3:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-07 23:45 [PATCH] pseries: phyp dump: Variable size reserve space Manish Ahuja
2008-04-08  2:43 ` Olof Johansson
2008-04-09 17:32   ` Manish Ahuja
2008-04-09 19:39     ` Segher Boessenkool
2008-04-10  1:36       ` Paul Mackerras
2008-04-10  3:10         ` Segher Boessenkool [this message]
2008-04-09 17:37   ` Manish Ahuja
2008-04-09 18:30     ` Olof Johansson
2008-04-09 18:43       ` Manish Ahuja
2008-04-09 18:59         ` Olof Johansson
2008-04-11 23:31 ` Manish Ahuja
2008-04-15  6:24   ` Paul Mackerras
2008-04-15 22:56     ` Manish Ahuja
2008-04-16 19:42       ` Joel Schopp
2008-04-16 20:22 ` Linas Vepstas
2008-04-18 19:08   ` Manish Ahuja

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=3ff8bdda029b9de8bb712012cec39ab3@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=linasvepstas@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mahuja@us.ibm.com \
    --cc=olof@lixom.net \
    --cc=paulus@samba.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.