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: Paul David Fox Subject: Re: Why not Solaris on Alpha? Date: 1997/06/19 Message-ID: <33A9431C.4D14@lehman.com>#1/1 X-Deja-AN: 251120601 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> Organization: None in particular Newsgroups: comp.unix.solaris,comp.sys.sun.hardware,comp.sys.dec R!ch wrote: > > 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?) My code samples are wrong, how about for a local variable: mov [ebp+nn],es mov [ebp+nn+2],ax Yes - on average its about the same no. of instructions (but less bytes than a SPARC); the 16-bit analogy is not good, because in 32-bit mode its one instruction. As for cycles - thats nearly irrelevent (ie difficult to measure). If we take pipelining/superscalar into account, how about 1 cycle? (I'm not speaking with expertise but its in that region). Generally the SPARCs win because their I/O and RAM busses are better than Intels. From an instruction point of view its an irrelevant comparison because I can compare a 40MHz SPARC with a 300MHz PII and you can compare the other way around. The bottom line is its not as bad as you think it is. > 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! Yup. > 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! Yes but if you treat a 286 or 386 in 16-bit mode as a 32-bit processor (albeit with crap instructions) you can ignore segments in their entirety and just treat them as 'the upper 16-bits' of an address -- no different from Sparcs %hi/%lo. The pain of segments is that to gain that extra ounce of performance people opt for 64KB code+data (ie small model) and then go to great lengths to reach outside their segments (e.g. optimised Windows code). FYI, SPARC suffers exactly the same small/large model issue but its very much hidden and no one jumps on it. Look at -K PIC and -K pic and the SPARC relocation address modes to see what I mean. > > 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) It depends (good answer, eh?). How about 6 bytes for a 32-bit load when from a 32-bit var on the stack 'nearby' (within +/-128 bytes); more if its further away. If MS had adopted large and only large model and stopped the idiocy with _near and _far in the C compiler then no-one would have cared about this on the x86. MS chose to expose the interface and everyone believed that was fine. Its only in the Win32 API that the distinction disappears (possibly to reappear in Win64?). On the other hand, Sun and the other Unix vendors are having pretty much the same issues in putting in 64-bit support into the kernel. But in the 32->64 bit transition, no one is too bothered about code segments > 4GB worth, so the problem is much easier in terms of migration. Intel's are bad for a number of reasons, but they are not that bad. ______________________________________________________________________ | This signature is deceased. RIP. It is an ex-signature. | | 1996-1997 - a dearly beloved friend. | ______________________________________________________________________