Gabriel Paubert <[EMAIL PROTECTED]> writes:

> On Wed, Jun 25, 2008 at 10:34:32AM -0500, Scott Wood wrote:
>> Kumar Gala wrote:
>> >>+/* Macros to workout the correct index for the FPR in the thread 
>> >>struct */
>> >>+#define FPRNUMBER(i) (((i) - PT_FPR0) >> 1)
>> >>+#define FPRHALF(i) (((i) - PT_FPR0) % 2)
>> >
>> >Have you looked at what the compiler spits out here to make sure we 
>> >aren't getting a divide?  Seems like we could use '& 0x1'.
>> 
>> GCC's not *that* dumb.  However, you may get some unnecessary 
>> sign-twiddling if "i" is signed.
>
> Not for modulo 2, it's only an even/odd choice

That's wrong.  -1 % 2 == -1, 1 % 2 == 1.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to