From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <775b8d190705032353u1bdf4528ve2e6ec3277017506@mail.gmail.com> Date: Fri, 4 May 2007 16:53:56 +1000 From: "Bruce Ellis" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] speaking of kenc In-Reply-To: <20070503192201.A22416@orthanc.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7560b2245493f07219455a36984c983f@coraid.com> <1178244537.16650.1835.camel@work.sfbay.sun.com> <20070503191149.G22416@orthanc.ca> <1178245220.16650.1845.camel@work.sfbay.sun.com> <20070503192201.A22416@orthanc.ca> Topicbox-Message-UUID: 58aa6792-ead2-11e9-9d60-3106f5b1d025 isn't it bleeding obvious by now that asm is dumb. a function call into something in a *.s file will do. you'll find a few entry points in your fave l.s. can i say dumb-asm on this list? i saw an attempt of ill-informed cleverness where spl() etc were picked up by the compiler and inlined. i guess he had nothing else to do with his life. maybe a 0.02% speedup. brucee On 5/4/07, Lyndon Nerenberg wrote: > >> That's called as(1). > > > > On any architecture with a non-trivial register allocation, the above > > statement does not apply. > > As far as performance goes you might be better off not using assembler > > to begin with. > > Exactly. If you want asm, you know where to find it. These days, the > cases where raw assembler really matters are significant enough that a few > in-lines generally don't accomplish anything. Yes, you can pollute your C > code with __asm(), but I could also argue for _f77() so that I could > compile spice (or more importantly, dungeon) with cc. Where does it end? > > > Compilers (at least the ones I work on) are quite smart > > in how they use precious resource such as registers, and unless you > > can hide everything away on the other side of the 'call' op you'd > > be in trouble mixing your code with what compiler had generated for > > you. > > Sure, the compiler can assist with register allocation, but so can reading > the ABI documentation. Once upon a time I spent way too much of my life > optimizing MIPS cycles out of the distributed.net client instead of > drinking beer. After watching the compilers blow away almost all of the > machine code optimizations people proposed, I filed great chunks of > in-lined cruft in the bin. The only asm code that mattered was the > carefully tuned *long* unrolled loop bit-shifting stuff. And it had an > execution time that made the call overhead invisible. > > > GCC style asm in-lines play nice with things like register > > allocator and instruction scheduler, where .s files don't. > > Only in the cases where asm code doesn't provide enough benefit to be > worthwhile. > > > What's 3B3 and ESS#5 ? ;-) > > A reasonable telephone switch billing system, and the worlds worst > multi-user UNIX timeshare box. Perhaps not in that order. (Or maybe it > *is* the right order.) > > > --lyndon > > In God we Trust -- all others must submit an X.509 certificate. > -- Charles Forsythe >