This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Right-shift bug in egcs-2.91.66


** Reply to message from Dale Johannesen <dalej@apple.com> on Fri, 11 May 2001
10:03:06 -0700


> Shifting by the word size is undefined in C/C++ (because the immediate 
> shift count field in much popular hardware can only hold 0..31).  You 
> need to write this as ((test>>31)>>1) or some such.

Ok, everything makes sense now.  I had forgotten that x86 only uses the lower 5
bits of the cl register for a 32-bit shift.  I apologize for my previous rant.


-- 
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]