Re: shr bug when shifting by a multiple of the int size?

2005-11-04 Thread Leopold Toetsch
On Nov 4, 2005, at 1:26, Luke Palmer wrote: On 11/3/05, Leopold Toetsch [EMAIL PROTECTED] wrote: Shifting anything by = the bits of the int isn't portable nor specified. Why isn't it specified? It seems to me that it should be zero. C standard (actually from a draft of C99) If the

Re: shr bug when shifting by a multiple of the int size?

2005-11-04 Thread Joshua Isom
But why should the result be an unportable/undocumented parrot op? If parrot's aiming for portability, so long as external libraries aren't used, shouldn't parrot treat code the same way for all platforms? Otherwise, each compiler for parrot would have to add in code to find out the size of

Re: shr bug when shifting by a multiple of the int size?

2005-11-04 Thread Leopold Toetsch
On Nov 4, 2005, at 18:24, Joshua Isom wrote: [ please top-post ] But why should the result be an unportable/undocumented parrot op? If parrot's aiming for portability, so long as external libraries aren't used, shouldn't parrot treat code the same way for all platforms? Otherwise, each

Re: shr bug when shifting by a multiple of the int size?

2005-11-04 Thread Jonathan Worthington
Joshua Isom [EMAIL PROTECTED] wrote: But why should the result be an unportable/undocumented parrot op? If parrot's aiming for portability, so long as external libraries aren't used, shouldn't parrot treat code the same way for all platforms? Otherwise, each compiler for parrot would have to

shr bug when shifting by a multiple of the int size?

2005-11-03 Thread Joshua Isom
I was trying to use bit shifting for division by multiples of two, but if the shift amount is a multiple of the int size, it seems to fail to shift the bits. Here's some example code demonstrating it. .sub _main @MAIN .local int a, b, c print a\tb\tc\n a = 24 b = 32 c = a

Re: shr bug when shifting by a multiple of the int size?

2005-11-03 Thread Leopold Toetsch
On Nov 3, 2005, at 20:49, Joshua Isom wrote: I was trying to use bit shifting for division by multiples of two, but if the shift amount is a multiple of the int size, it seems to fail to shift the bits. Here's some example code demonstrating it. .sub _main @MAIN .local int a, b, c

Re: shr bug when shifting by a multiple of the int size?

2005-11-03 Thread Luke Palmer
On 11/3/05, Leopold Toetsch [EMAIL PROTECTED] wrote: On Nov 3, 2005, at 20:49, Joshua Isom wrote: I was trying to use bit shifting for division by multiples of two, but if the shift amount is a multiple of the int size, it seems to fail to shift the bits. Here's some example code