🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #10495

Re: Compilers and efficiency

#10495
From: Preston Briggs
Date: Mon, 29 Apr 1991 15:59
37 lines
2239 bytes
hrubin@pop.stat.purdue.edu (Herman Rubin) wrote

> If the languages do not allow the user to communicate  the use of those
> features of the CISC architecture which can make the object code considerably
> faster, the compiler cannot take advantage of them.  This IS the situation.
> For example, suppose there was an instruction, which could be effectively
> used, which would divide a float by a float, obtaining an integer quotient
> and a float remainder.  Now just how is the compiler to recognize that this
> is in fact wanted?  

And I described how it could be done, using Fortran 77 and pretty
standard optimization (value numbering and peephole optimization).

hrubin@pop.stat.purdue.edu (Herman Rubin) replies:

>Any specific instance of this can be added to the compiler's ken, but
>until it does, the compiler cannot take advantage of it.  The point is
>that the compiler must be instructed to look for them.

Yes indeed.  That's the job of the compiler writer.
If he does a bad job in using the instruction set of the machine,
you should complain to him.

>The real2int conversion still has to be done on most machines, and also
>an integerize of real.  But suppose that the machine has integer hardware
>comparable to floating hardware, and can also handle unnormalized floats.

Well, we can suppose all sorts of things.  Nevertheless, my solution
handles your first set of suppositions.  If you change the machine,
you need to change compilers.

I thought your original question was posed in an attempt to show that
many languages don't have the facilities you consider necessary
to control the machine.  I just tried to show that the effect you
wanted could be achieved.

Preston Briggs
Technical Details
Message-ID: <1991Apr29.155945.29907@rice.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!rice!ariel.rice.edu!preston
References: <4082@batman.moravian.EDU> <1991Apr28.154603.8003@rice.edu> <11489@mentor.cc.purdue.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!rice!ariel.rice.edu!preston
From: preston@ariel.rice.edu (Preston Briggs)
Newsgroups: comp.arch
Subject: Re: Compilers and efficiency
Message-ID: <1991Apr29.155945.29907@rice.edu>
Date: 29 Apr 91 15:59:45 GMT
References: <4082@batman.moravian.EDU> <1991Apr28.154603.8003@rice.edu> <11489@mentor.cc.purdue.edu>
Sender: news@rice.edu (News)
Organization: Rice University, Houston
Lines: 37