Re: Optimizing in assembly language

Shankar Unni <sunni@speakeasy.net>
4 Mar 2001 01:54:32 -0500

          From comp.compilers

Related articles
Optimizing in assembly language rhyde@transdimension.com (Randall Hyde) (2001-03-01)
Re: Optimizing in assembly language jim.granville@designtools.co.nz (Jim Granville) (2001-03-04)
Re: Optimizing in assembly language sunni@speakeasy.net (Shankar Unni) (2001-03-04)
Re: Optimizing in assembly language ts3@ukc.ac.uk (T.Shackell) (2001-03-08)
Re: Optimizing in assembly language jguthrie@brokersys.com (Jonathan Guthrie) (2001-03-08)
Re: Optimizing in assembly language l-desnogues@ti.com (Laurent Desnogues) (2001-03-08)
Re: Optimizing in assembly language ceco@jupiter.com (Tzvetan Mikov) (2001-03-08)
Re: Optimizing in assembly language adrian@sartre.cs.rhbnc.ac.uk (A Johnstone) (2001-03-08)
Re: Optimizing in assembly language rhyde@transdimension.com (Randall Hyde) (2001-03-10)
[24 later articles]
| List of all articles for this month |

From: Shankar Unni <sunni@speakeasy.net>
Newsgroups: comp.compilers
Date: 4 Mar 2001 01:54:32 -0500
Organization: Posted via Supernews, http://www.supernews.com
References: 01-03-006
Keywords: assembler, performance
Posted-Date: 04 Mar 2001 01:54:32 EST

Randall Hyde wrote:




> So here's my question: why can't we write an "optimizing assembler"
> that lets the programmer specify machine sequences and the assembler
> does the same kinds of "book keeping" that a HLL compiler would do.


It's not such a wild-assed thought.


The key would be to wrap the assembler instructions in some high-level
construct that allowed you to match up the input and output memory
operands to concrete symbolic memory locations (stack or heap or
global variables), so that you could intermix assembly and C (HLL)
code, and have the two be optimized together.


GCC has some sort of a notation like this, except that they don't
actually touch the assembly sections, but merely uses those notations
to decide what side-effects a snippet of assembly code has. But it's
not all that hard to extend the model to also go in and try to fiddle
with the instructions themselves..


I also know of several attempts at "optimizing assemblers" (IIRC, the
HP-PA assembler used to have an "optimization" flag that attempted to
do do some basic instruction rearranging to achieve reasonable
pipelining and reduce stalls..


Also, the MIPS assembler tried (for the R3000) to ensure that you
didn't have any hazards (e.g. register write-read) in the code
(because the architecture didn't have any such protections).
--
Shankar Unni sunni@speakeasy.net
[Quite a while ago I read a paper about a Bell Labs language called LIL
that was intended as a level between C and assembler. They eventually
declared it a failure because in every case where they thought it would
be useful, it turned out to be easier overall to make their C compiler
emit better code and write in C. -John]





Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.