🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1225

Re: DECstation lui vs. li usage

#1225
From: Eliot Moss
Date: Mon, 28 Sep 1992 15:23
31 lines
1963 bytes
>>>>> On 24 Sep 92 16:03:52 GMT, glenn@curie.ces.cwru.edu (Glenn Crocker) said:

Glenn> gcc 2.2.2 on a decstation
Glenn> The basic question is:  why does this:

Glenn> 	li	$4,10000000

Glenn> become this:

Glenn>         lui     $4,(0x00980000)>>16     # Here's the source of my question.
Glenn>         ori     $4,$4,0x967f            # Why's it doing this instead of

Well, I can't say why one set of flags writes it out one way and the other
writes it a different way, but the MIPS cannot load a constant bigger than 16
bits in a single instruction. The li is a pseudo-op that expands to two
instructions, probably a lui followed by an ori as suggested in the MIPS
architecture book. I suspect that the pseudo-op is expanded when you request
instruction scheduling so as to admit the possibility of separating the two
instructions if that should be worthwhile. For example, a load of a different
register might be started earlier, and the ori put in the load instruction's
delay slot. Have no fear; both forms are doing the same thing at the machine
level.
--

J. Eliot B. Moss, Associate Professor	Visiting Associate Professor
Department of Computer Science		School of Computer Science
Lederle Graduate Research Center	Carnegie Mellon University
University of Massachusetts		5000 Forbes Avenue
Amherst, MA  01003			Pittsburgh, PA  15213-3891
(413) 545-4206, 545-1249 (fax)		(412) 268-6767, 681-5739 (fax)
Moss@cs.umass.edu			Moss@cs.cmu.edu
Technical Details
Message-ID: <MOSS.92Sep28102311@CRAFTY.cs.umass.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.umass.edu!moss
References: moss@cs.umass.edu (Eliot Moss)

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.umass.edu!moss
From: moss@cs.umass.edu (Eliot Moss)
Subject: Re: DECstation lui vs. li usage
Message-ID: <MOSS.92Sep28102311@CRAFTY.cs.umass.edu>
Sender: gnulists@ai.mit.edu
Reply-To: moss@cs.umass.edu
Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst)
References: moss@cs.umass.edu (Eliot Moss)
Distribution: gnu
Date: Mon, 28 Sep 1992 15:23:11 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 33