Path: utzoo!utgpu!bnr-vpa!bnr-rsc!jim
From: jim@bnr-rsc.UUCP (Jim Somerville)
Newsgroups: comp.arch
Subject: Shifting question
Message-ID: <705@bnr-rsc.UUCP>
Date: 12 Jul 88 18:28:02 GMT
Organization: Bell-Northern Research, Ottawa, Canada
Lines: 18

I have a question on how compilers should handle shifting.
Consider the following:

unsigned int x;		/* ints are 32 bits */
unsigned int y;

y = x>>32;  /* the 32 could also be the value of another variable */

What should be the value of y after the shifting is complete?
a) x
b) 0
c) none of the above

Do I have a valid complaint if the compiler I am using gives x?
-- 
Jim Somerville (bnr-vpa!bnr-rsc!jim)	Phone:	(613) 763-4497
Bell-Northern Research			Usenet:utgpu!bnr-vpa!bnr-rsc!jim
P.O. Box 3511, Station C, Ottawa, Ontario, Canada, K1Y 4H7