12 ms·
Intel x86 documentation has more pages than the 6502 has transistors
- mwcampbell 10y agoIs the situation appreciably better with ARMv8? How about ARMv7?
- static_noise 10y agoIs the situation with x86 bad to begin with? Granted, I didn't read the full documentation provided online for my hardware before I powered it on. Honestly, I didn't read any documentation and it just works, kind of.
- mwcampbell 10y agoDepends on how much of the complexity described in those thousands of pages of documentation is actually necessary, and how much could be eliminated with a better design.
- Someone 10y agoLots of it isn't so much bad design as not willing to give up backwards compatibility. Some examples: - the old floating point register stack and its 80-bit registers - I don't know how many iterations on SIMD instructions (MMX, a few iterations of SSE, a few iterations of AVX, various prefixes to make older instructions use newer registers) If you got rid of those, you also could get rid of quite a few prefix instructions, maybe a configuration bit here and there, etc. It also doesn't help that, at times, Intel and AMD independently added stuff to the x86.
- pcwalton 10y agox86-64 has tons of cruft: complex instruction encoding (mod R/M and SIB bytes), bloated instruction encoding thanks to REX prefixes, real mode, virtual 8086 mode, odd SIMD limitations, pointless instructions like XLAT, binary coded decimal, a non-orthogonal instruction set with some 3-register instructions (LEA, IMUL, AVX2) mixed with a bunch of other 2-register instructions, individually addressable low and high bytes of certain registers but not others…
- h4nkoslo 10y agoMost of that cruft consumes minimal die area and results in absolutely minimal slowdown compared to an "optimized" minimal architecture. Fun exercise: do a histogram of instructions in some large program's binary. Not a ton of weirdness in practice.
- pcwalton 10y agoI'm not disputing that. I'm talking about complexity of the programming model (number of pages in the manual), not performance.
- flamedoge 10y agoWhat was the main reason to add REX prefix for 64bit? Why not create longer register bits to hold 16 registers? Was it for easier binary to binary transformation?
- pcwalton 10y agoBecause AMD was deathly afraid of AMD64 going the way of Itanium. So they went out of their way to make their architecture as similar to 32-bit x86 as possible, right down to reusing the encoding. They also probably figured that they could reuse decoding logic.
- Redoubts 10y agoThe paper on the Design of RISC-V has a really good survey of existing ISA like x86: https://people.eecs.berkeley.edu/~krste/papers/EECS-2016-1.pdf https://people.eecs.berkeley.edu/~krste/papers/EECS-2016-1.p...
- Kubuxu 10y agoTo show complexity of x86-64 it is best to look at boot process. You processor starts in 16bit mode, then is upgraded to 32bit and then to 64bit mode. You want to do some call to BIOS now? You have to downgrade through 32bit mode to 16 bit mode to do that and then back up to handle the response. And it is just very small component of cruft that x86-64 has.
- amluto 10y agoThis particular issue is overhyped IMO. 64-bit UEFI mostly bypasses it. Sure, the firmware entry point has some bootstrapping to to, but this isn't a big deal. The really weird initial state of SMM is a bigger deal since it happens at runtime.
- hlandau 10y agoThe rate at which the complexity of the amd64 boot process is increasing is quite alarming. UEFI is an overcomplicated, buggy monstrosity, but that's just the tail end of the "boot process". Nowadays, to get an x86 CPU to execute a single opcode, you need to have a Management Engine (or Platform Security Processor, in AMD-speak) firmware blob resident in the firmware flash chip. More modern CPUs, for Intel, say, oblige you to use Intel-provided "memory reference code" and other "firmware support package" blobs just to initialize the CPU in the early stage. AFAIK, Intel isn't even bothering to document the details of its CPU and chipset initialization sequences anymore, in favour of just making people use unexplained blobs. These are just some of the issues the coreboot project is having to deal with. It really feels like at least in the world of x86, the window is rapidly closing on projects like coreboot being able to accomplish anything useful, although there are at least some major users like Chromebooks. And then of course we have things like SMM, and the way in which secure firmware updates are facilitated (which relies on things like flash write protect functionality)...
- djsumdog 10y agoThose blobs are run by the BIOS/UEFI correct? Like Grub/the Linux kernel don't need those Intel blobs just to get booting do they?
- monocasa 10y agoARMv7 was already approaching x86 levels of complexity. Something like 1200 instructions and 30 years of cruft.
- pcwalton 10y agoMost ARMv8 CPUs in the wild are backwards compatible with 32-bit ARM and Thumb (able to switch modes on CPU exceptions), but AArch64 is a near-complete redesign of the ISA to eliminate cruft. It's very nice that ARM removed things like the conditional execution, weird behavior of the "pc" register, and most of the barrel shifter complexity. It is not an architectural requirement for ARMv8 processors to implement the 32-bit ARM ISA (though of course for practical reasons they do today). So, eventually, if we start seeing ARMv8 processors that eliminate the 32-bit compatibility, we may see a nice architectural simplification (though I wouldn't be surprised if the transistor count doesn't decrease that much).
- mwcampbell 10y agoI think Apple will be the first to drop 32-bit compatibility, since they've been requiring 64-bit support in all iOS App Store submissions for a while now.
- dpc_pw 10y agoDefinitely. As a dominant platform owner they can push everyone to bend over backwards all the time. And they will since any fab and power savings will be totally worth it for the user, even if they marginal.
- flukus 10y agoSo AArch64 is simpler? Could we expect a simpler architecture to take a performance lead in future?
- pcwalton 10y agoYes, it's significantly simpler. I would be very glad to see that yield a performance increase, though I suspect the difference would be small.
- nn3 10y agoIf you go by pages in the specification https://people-mozilla.org/~sstangl/arm/AArch64-Reference-Manual.pdf https://people-mozilla.org/~sstangl/arm/AArch64-Reference-Ma... is 5183 pages, which is about 10% longer than the Intel manual, which currently has 4670 pages.
- static_noise 10y agoThey continue to add transistors to newer processors. It is a good sign that someone keeps track of them and writes documentation on how to use all these new transistors.
- Cyph0n 10y agoI heard they added a couple of transistors to the latest Intel chips. One of the transistors hasn't been documented yet, though, which is unlike Intel.
- ethbro 10y agoI'm imagining the documentation for an individual transistor that extends all the way up the stack... and thinking about Escher for some reason.
- mycall 10y agoThis makes me wonder how many undocumented transistors are on the chips -- there because nobody knows why.
- andromeduck 10y agoApparently Nvidia had to drop VBIOS a bit early because it started having issues but they no longer had enough people who knew how it worked to continue supporting the feature.
- the_duke 10y agoNow just imagine how many tens of thousands of pages Intel has on internal documentation...
- bonzini 10y agoAnd still no one knows why x86 control registers are CR0, CR2 and CR3. What was CR1 supposed to be used for?!? (This is actually true. I asked x86 architects when I met some).
- Someone 10y agoAccording to http://www.pagetable.com/?p=364 http://www.pagetable.com/?p=364 (which also shows part of the reason the x86 needs so much documentation, by the way), it started its life "reserved", and never got a real role in life.
- bonzini 10y agoYes, but: "instead of overflowing the new bits into CR1, Intel decided to skip it and open up CR4 instead – for unknown reasons."
- vidarh 10y agoSounds like someone took "reserved" a bit too seriously and/or couldn't figure out who had marked it reserved or why, and decided the latter was the safer option.
- yuubi 10y agoSounds like someone meant to use CR1 after CR0, but someone bit-swapped the CR-number bus so you have to encode 4 in the instruction to get 1 where it needs to go.
- rbanffy 10y ago"We don't talk about CR1". ;-)
- tetrep 10y agoProbably be good to add (2013) to the title as that was both when it was written and the latest x86 documentation at the time. Since then, it looks like the manual as 4670 pages now[0], which surpasses the 6502's "all transistors but ROM/PLA" count. At this rate, 1419 pages over 3 years, the Intel x86 documentation's page count will exceed all transistor counts of the 6502 around 2020. [0]: https://software.intel.com/en-us/articles/intel-sdm#combined https://software.intel.com/en-us/articles/intel-sdm#combined
- amelius 10y agoMoore's law for documentation?
- Aardwolf 10y agoNot sure about that one, seems like an inverse law to me, computer games used to come with big booklets with documentation and backstory, now nothing (other than user made wikis of course). Or a mobile dumbphone came with a manual explaining all the menus and options. Now the only paperwork with a smartphone is legal and warranty.
- wott 10y agoOh, I swear it is not inverse for chip documentation (unless it's from a Chinese manufacturer, you have to do with a 2-page leaflet for a 80-pin chip in that case). But it doesn't necessarily mean it is exhaustive high quality doc. First, we have to acknowledge that most texts (if works for law too) are very diluted now compared to a few decades. There is a lot of blah-blah that doesn't bring information. Information density decreased. Then, there are docs that are so big (many many thousands pages), that I am sure no editor can read them fully. They pile up copy-paste from older or similar models without checking if it applies to the chip. They don't write a clean doc specifically for the chip. So as a user you can trash parts of the doc. Problem is that you don't know which ones. Since they don't print manuals any more, they don't have to care about fitting the doc in the book, it's no-limit.
- bigiain 10y agoHeh - the first computer in my home was an Osbourne "portable" - a Z80 CP/M machine. It's user manual came with a wiring diagram! (Which I used as a ~12 year old to work out how to connect a home built 4 micro switch and 2 puch button joystick to the printer port, so I could write blocky text/graphic versions of video games I wanted to play.)
- dpc_pw 10y agoSome comments miss the point. I don't think it's a suggestion that x86 has too much documentation or too much transistors. It just gives a picture in to how the hardware exploded in capacity, complexity and so on. Which is great (though obviously comes with a cost).
- Taek 10y agoI disagree that it's great. The immense complexity associated with creating a competitve x86 processor gives Intel a huge competitive moat. You can't make a competing processor without billions of dollars of R&D. As a result Intel is able to deploy highly unfavorable features like the Management Engine and consumers don't feel like they have an alternative. A reasonable alternative like Talos costs $3700. If startups could reasonably compete with traditional volumes of funding, we'd probably have better hardware.
- m_mueller 10y agoIt seems to me more and more that Intel has relied way too much on x86 to shut out competition in the last 10-15 years. The world is currently moving onto greener pastures (lower power / higher performance per watt) and Intel is loosing more and more of their market at the bottom and top ends. Xeon Phi and their failed x86 mobile adventures to me are the prime indications that they bet too much on one horse.
- lobster_johnson 10y agoIs the x86 architecture itself limited in its adaptability compared to others such as ARM? If yes, why and if no, why are Intel's mobile/low-power attempts failing?
- m_mueller 10y agoThe way I understand it, x86 does quite a lot in hardware what could be done in Software (compiler) just as well. That includes backwards compatibility to a whole host of instruction sets / extensions. All this seems closely linked to the IBM PC standard and Microsofts software strategy. All of this costs power. The result is that you can either have a mobile x86 that's competitive on power or on performance, but not both.
- hota_mazi 10y agoSomebody needs to come up with a law that correlates the size of a processor's documentation to the number of transistors on that processor.
- andrewbinstock 10y agoMark Papermaster[0] should formulate that law. [0] https://en.wikipedia.org/wiki/Mark_Papermaster https://en.wikipedia.org/wiki/Mark_Papermaster
- ChuckMcM 10y agoIt it is one of those interesting metrics, or one I came across researching the Cortex-M which is that at modern process node geometries the CPU part of a Cortex-M chip (not including all of the on chip peripherals, RAM, and Flash) easily fits inside the bond pad of an 8080A. As the 8080A had 40 pins that is 40 Cortex-M CPUs in silicon that Intel "threw away" by depositing a square of gold on the silicon. But in terms of documentation that is related directly to the transistors, it would be interesting to evaluate number of lines of VHDL to the number of inferred transistors. I know you get a report after you have finished place and route on your typical work flow but has anyone rolled that up to "2.5 lines of VHDL per 100 transistors" or something?
- Keyframe 10y agoSomeone here did the math before. Motorola 68k was fabricated on 3.5um node. If it were made today with 14nm node, it (the whole 68k) would fit on an area of a single transistor from the original 68k made with 3.5um node. That's 68,000 Motorola 68000s inside an original Motorola 68000! With newer nodes, even more.
- en4bz 10y agoI would say that roughly 25% of the documentation applies to ancient modes of operation like real mode and protected mode. Unless you REALLY need to know the fine details of these modes you can skip right to the long mode stuff.
- johncolanduoni 10y agoWindows still uses a lot of programs in emulated protected mode, so it's pretty relevant still.
- jianina 10y agoHow can i order these books
- kens 10y agoOrdering details for the Intel architecture documentation are at https://software.intel.com/en-us/articles/intel-sdm https://software.intel.com/en-us/articles/intel-sdm - the volumes range from $8 to $23 depending on size. I think the documentation was free when I got it but times have changed. Edit: you can download the PDF (for free) from that link too. It's quite a surprise to go to HN and see my post from 2013 here, by the way.
- user5994461 10y agoYou can download them from intel website for free. Source: I've got the x86 and x64 manual instructions set from there, which is thousands of pages in PDF. Rootkits ain't gonna write themselves =)
- jianina 10y agoHow can i order these books
- rasz_pl 10y agoDoes that include all the secret documentation for stuff like LOADALL, ICEBP etc? http://www.drdobbs.com/undocumented-corner/184410285 http://www.drdobbs.com/undocumented-corner/184410285 http://www.rcollins.org/articles/loadall/tspec_a3_doc.html http://www.rcollins.org/articles/loadall/tspec_a3_doc.html You will love this paragraph: "Unlike the 286 LOADALL, the 386 LOADALL is still an Intel top secret. l do not know of any document that describes its use, format, or acknowledges its existence. Very few people at Intel wil1 acknowledge that LOADALL even exists in the 80386 mask. The official Intel line is that, due to U.S. Military pressure, LOADALL was removed from the 80386 mask over a year ago. However, running the program in Listing-2 demonstrates that LOADALL is alive, well, and still available on the latest stepping of the 80386." Just imagine whats in Intel chips now due to NSA pressure :/
- ethbro 10y agoFor those curious about the "what" and who don't know x86 opcodes from memory, from the first link and in its earliest incarnation, "LOADALL restores the microprocessor state from the State Save Map that is saved during the transition from user mode to ICE mode. LOADALL loads enough of the microprocessor state to ensure return to any processor operating mode."
- mikeash 10y agoWhy would the US military be pressuring Intel to remove obscure instructions in ancient CPU designs?
- qb45 10y agoNot sure what to love here, it's a debug feature which, according to your source, Intel promised the US Mil to remove for some reasons but ultimately didn't. There certainly are undocumented debug facilities in modern CPUs. For one example, the leaked Socket AM3 datasheet clearly shows a JTAG interface, though I don't know if it's operational in production silicon. Hopefully, debug capabilities cannot be used to pwn the CPU from unprivileged code without external debug hardware which could pwn the CPU anyway by itself. It's not even clear if they are enabled in production chips at all. LOADALL for example worked only in RING0 and got ultimately removed early in the 486 days so it seems Intel cared about security somewhat (and probably also about future compatibility, to be honest, it's not fun when software relies on features you want to change in the next generation). Nowadays they should care even more - if software backdoors were available and leaked to the public, the magnitude of shit happening in all those cloud companies would be monumental.
- CalChris 10y agoSo this post is supposed to show a relationship between transistors and documentation. Fine. x86 has 4181 pages of documentation. Quad-core Skylake has 1.75 billion transistors. This is 418560 transistors per page. The 6502 had 12 pages of documentation. It had 3,510 transistors. This is 292 transistors per page. Advantage x86.
- Narishma 10y agoYou're comparing a single-core to a quad-core. Moreover, the Skylake is an SoC that contains stuff other than the CPU cores.
- CalChris 10y agoYes, Skylake is superscalar, hyperthreaded, multicore, SIMD, OOO, speculative and a few other things too. Yes, Skylake contains GPU stuff in its transistors and also in its documentation.
- theparanoid 10y agoCache is the majority.
- bbcbasic 10y agoBut if you have a box of 10k 6502's you can use the same 12 pages of docs and get 2920000 transistors per page.
- qb45 10y agoBut it's only fair to compare Skylake with at most a dozen or two of 6502s because that's how many cores are included in the Intel chip.
- mycall 10y agoSPARC M7 wins at 10,000,000,000 transistors.
- 10y ago
- Waterluvian 10y agoMaybe I'm naive, but it seems incredibly impressive that the 6502 only has that many transistors!
- avhon1 10y agoWell, it's a pretty simple CPU. It only had 56 instructions, 40 pins, and 8 bytes of registers. It assumes direct, single-cycle access to memory. It was originally supposed to have a ROtate-Right instruction, but it had a bug, so the instruction was not included in the manual. Also, invalid instructions are not detected, leading to the discovery of ROtate-Right and some accidental instructions, as well as the creation of some cool extra-instruction-trapping hardware. The LGP-21 [0] has the fewest transistors for any mass-market computer I've read about - 460, and 300 diodes. [0] https://en.wikipedia.org/wiki/LGP-30#LGP-21 https://en.wikipedia.org/wiki/LGP-30#LGP-21
- bigiain 10y ago<showing my age here> When I remember all the stuff you could do on an AppleII (and a BBC Micro) with their tiny four odd thousand transistor cpus and 4 whole KB of ram - and consider how much time I spend waiting for this laptop with it's billion-or-so transistor cpu and 16 GB of ram - it's almost enough to make you weep about the profligate waste of resources of the entire software engineering profession... ;-)
- 72deluxe 10y agoI sometimes think that. I am amazed at when I look back at the BBC Micro and think of the software I used to run on there, and how they did it with such tiny amounts of RAM. I do realise that the last 20 years of GUI progress has stalled and that you could take a Mac from yesteryear or PC from ~1991 and know your way around it without any trouble at all. Of course software development strategies have changed and languages now let us express ourselves in previously unimaginable ways, but we've come so far and not far at all. I am particularly struck with the craze over the last 5+ years with regard of "cloud" and shoving data to the other side of the world, particularly given the microcomputer revolution and the lack of need to shove your data elsewhere. That's what the microcomputer is for!
- petercooper 10y agoI'd be keen to see a comparison of transistors counts between modern and older processors with caches removed (I could be wrong, but I thought built-in caches made up the majority of transistor counts nowadays). That is, how much more complex is a single cache-less core now vs then? Not as much as the overall transistor count would indicate, I suspect.
- ktRolster 10y agoThey're pretty complex. For example, the modern x86 (afaik) uses lookup tables to make multiplication faster. The 6502 didn't even have integer multiplication.
- vidarh 10y agoYes, we rolled it ourselves with ASL's (Arithmentic Shift Left) and ADC's (ADd with Carry) and the like, typically hardcoding it if we knew one of the operands. Particularly fun with pretty much always having to be prepared to deal with overflow since the registers are only 8 bit. I love the 6502, but I can't say I miss that part.
- qb45 10y agoAnnotated die photo of a single-core VIA Nano chip from some 10 years ago: https://en.wikipedia.org/wiki/File:VIA_Isaiah_Architecture_die_plot.jpg https://en.wikipedia.org/wiki/File:VIA_Isaiah_Architecture_d... As you can see, caches are merely half of the chip and half of the rest is about dynamic instruction reordering, branch prediction, register renaming and stuff. These things have pipelined execution units so they can start a new instruction before the previous one is finished executing, enough duplication to start executing two or three instructions per cycle (sometimes even of the same kind, say two floating point SIMD additions) and logic to schedule instructions wrt data dependencies, not program order, so that instructions which need input data not yet available can wait for a few cycles while other, later instructions are executing. And all of this has to be done with some degree of appearance of executing instructions serially, so if say some instruction causes a page fault and a jump to the OS fault handling code, the CPU has to cancel all later instructions which may have already finished executing :) And, btw, this is not in any way specific to x86. POWER, high-end ARM, they all do it.
- CamperBob2 10y agoSomebody posted a great educational video narrated by William Shatner in the late 1970s: https://www.youtube.com/watch?v=VJmero_L7g0 https://www.youtube.com/watch?v=VJmero_L7g0 (14 mins). Shatner plays it pretty straight here, and he does a great job of making the subject mattter interesting to audiences of the day. What's interesting about the video now is that every time he promises us "Thousands of transistors on the head of a pin," you can remind yourself that what we actually got was billions of transistors. It's humbling from a software engineering perspective to contemplate how poorly we're taking advantage of the semiconductor industry's Promethean gift. My computer still looks a lot like the Apple IIs and TRS-80s did in that video, and the same is true for my workflow.
- kazinator 10y agoThe point is that this is wrong. It's hardware; hardware should be simple. It's operating systems, languages, libraries and applications that (if anything) should have the proverbial "wall of manuals", not the machine architecture. Power on reset, shift, decode, execute, repeat. Intel loves complexity, which is why they invented USB: another tree killer. The processor doesn't do anything. In all that silicon and its pages of documentation, you can't even find a parser for assembly language; you need software for that. In spite of 4000+ pages of documentation, printing "Hello, world" on a screen requires additional hardware, and a very detailed program. Want a linked list, or regex pattern matching? Not in the 4000 pages; write the code. And this is just the architecture manuals software developers. This is not documentation of the actual silicon. What it contains: This document contains all seven volumes of the Intel 64 and IA-32 Architectures Software Developer's Manual: Basic Architecture, Instruction Set Reference A-L, Instruction Set Reference M-Z, Instruction Set Reference, and the System Programming Guide, Parts 1, 2 and 3. Refer to all seven volumes when evaluating your design needs. Instruction set references and system programming guide; that's it! Note also that this is not the programming documentation for a system on a chip (SoC). There is nothing in this 4000+ page magnum opus about any peripheral. No serial ports, no real time clocks, no ethernet PHY's, no A/D D/A converters; nothing. Just CPU.
- andars 10y ago"Intel loves complexity" Intel loves performance, because people want performance. Complexity is the cost of increased performance. As an example, I would guess that of the ~2000 pages of the instruction set reference, at a minimum 1000 pages document the various SIMD instructions. You don't need those, or the floating point operations, or SHA instructions, but I don't see any harm done by making them available.
- kazinator 10y ago1000 pages comes close to ANSI Common Lisp [1994], which is still criticized by some bitter old Lisp trolls for its size. It's just some CPU instructions! Maybe they aren't doing a good job of describing them succinctly?
- _RPM 10y agoTried to compile it, it worked, but it segfaults on executing `./vm`
- yuhong 10y agoIt is probably not difficult to create a new x86 version that is user mode compatible with most modern programs but lacks things like segmentation and real mode. New OS versions would be required, but most modern user mode programs would work with few if any modifications.
- vidarh 10y agoThings like Linux should work fine with a CPU that strips 16 bit mode entirely (32 bit too, possibly? not sure) as long as you have a BIOS / boot loader that can handle it and - as of when I last looked at the Linux kernel initialisation code over a decade ago - change / strip out a handful of lines that took care of changing the mode. It'd be interesting, but I don't think it'd save all that much unless you strip 32 bit compatibility as well, and even then it might be less than you think or they probably would have tried to see if the market would want it...
- yuhong 10y agoA lot of microcode is about things like segmentation and TSS.
- husky_voice 10y agoThat documentation has more letters then sunny days in Phoenix. bullshit statistic in action
- sebcat 10y agoIf anyone's interested in the 6502, or CPU design in general, this is a very good simulator: http://visual6502.org/JSSim/index.html http://visual6502.org/JSSim/index.html
- 72deluxe 10y agoThanks for this link. I have no idea what it's doing but it is an interesting start!