Path: utzoo!utgpu!water!watmath!clyde!att!ucbvax!hplabs!pyramid!weitek!mahar
From: mahar@weitek.UUCP (Mike Mahar)
Newsgroups: comp.arch
Subject: Re: Shifting question
Message-ID: <392@attila.weitek.UUCP>
Date: 15 Jul 88 17:18:18 GMT
References: <705@bnr-rsc.UUCP>
Reply-To: mahar@attila.UUCP (Mike Mahar)
Organization: WEITEK Corporation, Sunnyvale, CA
Lines: 14

The question (x>>32) has come up.  K&R and ANSI-C say the result is undefined.
The 68000 shift instruction will give you a 0.
The 80286 shift instruction will give you a 0.
The 80386 shift instruction will give you x.
The Weitek XL shift instruction will give you x.
I don't know what MIPS Co. 88000 or 29000 return but I suspect the C compiler
does what the instruction does.
The result stems from whether the machine truncates the shift amount to 5 bits
before doing the shift.  It is easy to see why the C standards punt on the
issue.

-- 
	Mike Mahar
	UUCP: {turtlevax, cae780}!weitek!mahar