From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f4671,b1738035b01d4980 X-Google-Attributes: gidf4671,public X-Google-Thread: 11035d,b1738035b01d4980 X-Google-Attributes: gid11035d,public X-Google-Thread: 1164f8,b1738035b01d4980 X-Google-Attributes: gid1164f8,public From: R!ch Subject: Re: Why not Solaris on Alpha? Date: 1997/06/19 Message-ID: #1/1 X-Deja-AN: 251094501 Distribution: inet References: <5mrt16$eo3@percy.cs.bham.ac.uk> <339EC070.390D@brussels.lhs.be> <5nn2j5$12h@cucumber.demon.co.uk> <339F9F56.1E4D4CFD@lehman.com> <5o8r6m$ner@ktel.osc.edu> <5o9ehl$8np@cocoa.brown.edu> <33A90AD7.3F54BC7E@lehman.com> X-Sender: richardt@infernal Organization: Sun Microsystems Inc., Mountain View, CA Newsgroups: comp.unix.solaris,comp.sys.sun.hardware,comp.sys.dec On Thu, 19 Jun 1997, Paul David Fox wrote: > Oops. Be very careful R!ch. If you look at Sparc assembly > language it is not that dissimilar to x86 large-model 16-bit > code. > > Why? Well you cannot load a 32-bit constant into a 32-bit > register in one instruction and you have to do it in two 'halves'. > > ld %hi(addr),reg > or %g0,%lo(addr),reg > > Now that aint too disimilar to: > > mov seg:addr,reg > mov reg,dst > mov offset:addr,reg > mov reg,dst+2 Except that it's twice the number of instructions! Also, your SPARC example will execute in (at most) 2 cycles; how many will the x86 one take? (Seriously, I haven't a clue - presumably 4, but who knows?) The SPARC method is the way it is because of the requirement for all instructions to be the same size (ie 32 bits) - you can't (obviously) specifiy a 32 bit constant in an instruction that has to be 32 bits long! I don't know the history behind segment stuff in x86, apart from maybe some sort of desire to remain compatible with the 8080 in some way... But I was really getting at is the 64K segment foolishness that resulted from having a 'segment' - and indeed the very concept of 'large (and others) model' programming in the first place! > Of course SPARC is a RISC so no one bothers to criticise it, but > it does contribute to code-bloat. Each of the 32 bit loads takes 8 bytes rather than 4; how many bytes does the x86 example take? (Again, not a rhetorical question - I have no idea. I stopped looking at x86 *years* ago) -- R!ch If it ain't analogue, it ain't music. #include \\|// - ? (o o) /==================================oOOo=(_)=oOOo========\ | Richard Teer richard.teer@uk.sun.com | | Sun Service Contractor | | Voice: +44 (0)1276 691974 | | .oooO | | ( ) Oooo. | \===================================\ (==( )==========/ \_) ) / (_/