🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #10484

Re: Compilers and efficiency

#10484
From: Preston Briggs
Date: Sun, 28 Apr 1991 15:46
28 lines
1654 bytes
hrubin@pop.stat.purdue.edu (Herman Rubin) writes:

> 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?  

In Fortran, you might write

	iq = f1 / f2

and a while later (during which f1 and f2 are not changed)

	fr = amod(f1, f2)

The compiler could recognize, during value numbering, that an
quotient and remainder of the same operands was being computed.
During instruction selection (or perhaps peephole optimization),
it could recognize that it could avoid the real2int conversion
of the quotent by using the "hrubin" instruction.

Not everyone does these things the way I've described them, but many
compilers can achieve the same effect, one way or another.

Preston Briggs
Technical Details
Message-ID: <1991Apr28.154603.8003@rice.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!cs.uoregon.edu!ogicse!milton!uw-beaver!rice!ariel.rice.edu!preston
References: <9782@mentor.cc.purdue.edu> <4082@batman.moravian.EDU> <11411@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!mips!cs.uoregon.edu!ogicse!milton!uw-beaver!rice!ariel.rice.edu!preston
From: preston@ariel.rice.edu (Preston Briggs)
Newsgroups: comp.arch
Subject: Re: Compilers and efficiency
Message-ID: <1991Apr28.154603.8003@rice.edu>
Date: 28 Apr 91 15:46:03 GMT
References: <9782@mentor.cc.purdue.edu> <4082@batman.moravian.EDU> <11411@mentor.cc.purdue.edu>
Sender: news@rice.edu (News)
Organization: Rice University, Houston
Lines: 28