This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: portable signed right shift
- To: dewar at gnat dot com, nbecker at fred dot net
- Subject: Re: portable signed right shift
- From: dewar at gnat dot com
- Date: Tue, 27 Mar 2001 22:36:05 -0500 (EST)
- Cc: crosby at qwes dot math dot cmu dot edu, gcc at gcc dot gnu dot org, tm2 at best dot com
<<Sorry, I meant right shift of 2's complement signed number.
>>
I know, and that was my example
-5 = 11111111111111011
-2 = 11111111111111110
Most people would expect either
11111111111111101 (if sign extension)
01111111111111101 (if no sign extension)
and the divide will typically give
11111111111111110