🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50149

Incompatibility with long right shifts not in the info pages

#50149
From: Nick Haines
Date: Wed, 17 Nov 1993 13:45
15 lines
1243 bytes
On SPARCs, the sra instruction shifts right by the nominal amount
modulo 32. And yet this instruction is generated by gcc (2.3.3) for

	(x >> y)

(where y is unknown). So for y>=32, one obtains a result incompatible
with ISO C, which specifies simply floor(x/2^y). I don't know if this
is true under any other architectures.

I assume this is known about, since for known y (e.g. x >> 48) the
instruction generated has an immediate value of y mod 32, (sra
%o1,0x10,%o1 in this case), presumably for compatibility with the
"unknown y" case.  So why isn't it in the info pages?

Nick Haines nickh@harlequin.co.uk
Technical Details
Message-ID: <7452.753543647@gamgee>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!harlequin.co.UK!nickh

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,f753af2a6e079d94,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-11-17 08:21:23 PST
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!harlequin.co.UK!nickh
From: nickh@harlequin.co.UK (Nick Haines)
Newsgroups: gnu.gcc.help
Subject: Incompatibility with long right shifts not in the info pages
Date: 17 Nov 1993 08:45:16 -0500
Organization: GNUs Not Usenet
Lines: 15
Sender: daemon@cis.ohio-state.edu
Distribution: gnu
Message-ID: <7452.753543647@gamgee>