Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!mintaka!spdcc!iecc!compilers-sender From: pardo@june.cs.washington.edu (David Keppel) Newsgroups: comp.compilers Subject: Re: Inlining and global references Keywords: architecture, optimize Message-ID: <1991May5.223113.21307@beaver.cs.washington.edu> Date: 5 May 91 22:31:13 GMT References: <1991May2.212633.6893@beaver.cs.washington.edu> <1991May1.035622.25021@daffy.cs.wisc.edu> <9105031839.AA10328@curley.osf.org> Sender: compilers-sender@iecc.cambridge.ma.us Reply-To: pardo@june.cs.washington.edu (David Keppel) Organization: Computer Science & Engineering, U. of Washington, Seattle Lines: 25 Approved: compilers@iecc.cambridge.ma.us pardo@cs.washington.edu writes: >>[Accessing globals may be no faster than accessing locals] In article <9105031839.AA10328@curley.osf.org> meissner@osf.org writes: >[Locals may be faster: 2-instruction sequence instead of one > sp-relative instruction.] John Levine writes: >[On many CISCs, the stack reference is shorter than absolute.] The MIPS compilers try to pack global references together so that global data can be referenced with a single-instruction offset from a `globals area' pointer that is assigned to a physical register. I don't have any data about how well the technique works, but the net result if it does work is that global and local references take the same space and time. If the instruction set can make N-bit offsets in a single instruction, then the technique only works for less than 2^N bytes of data. Hence my original claim ``may be no faster'' :-) ;-D on ( Byteing the data that feeds you ) Pardo -- Send compilers articles to compilers@iecc.cambridge.ma.us or {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.