From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <775b8d190705042214u63884855t8ffd2fc84853aa84@mail.gmail.com> Date: Sat, 5 May 2007 15:14:24 +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: <1178341898.8179.25.camel@work.sfbay.sun.com> 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> <1178341898.8179.25.camel@work.sfbay.sun.com> Topicbox-Message-UUID: 5a95544a-ead2-11e9-9d60-3106f5b1d025 i meant it. asm is gone, or should have been many years ago. explain a simple case when you need it. brucee On 5/5/07, Roman Shaposhnick wrote: > On Thu, 2007-05-03 at 19:35 -0700, 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. > > I partially agree with you, but anything in hardware that isn't > directly represented by C semantics is a fair game for using > __asm's. In fact, it is the only way to make your software look > good on a particular platform. I don't know how to fix that with > C and it seems that the rest of the posters on this thread don't > really know either. But this is a problem. > > > > 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. > > The problem is not register allocation per se, but how it ties into > instructions scheduling, piplining and all that jazz. And no, you can't > beat a smart compiler on architectures as complex as AMD64 and EM64T. > > Thanks, > Roman. > >