4 ms·
Possibly a meta question on instructions: is there such a thing as having 'too many'? I know transistors are cheap, but at what point is it diminishing returns
by throw0101a 7y ago
Possibly a meta question on instructions: is there such a thing as having 'too many'?
I know transistors are cheap, but at what point is it diminishing returns on new instructions? How many different use cases need to be handled? Certainly there are new situations that need to be handled (e.g., H.264/5/6, AV1 video), but will there ever be a point where we can say "this is enough"?
- vbezhenar 7y agoWhen you can put more transistors, you have to use them for something. You can either put more cores, but that requires for software to be written in a way to utilize those cores and that's not always easy task or even possible. Or you can use those transistors to make some common operations faster and that potentially will increase performance with little rewrites (or even with no rewrites for libraries). "This is enough" will be said when we wouldn't be able to put more transistors. I think that it won't happen in the next 10 years, but, of course, it'll happen eventually.
- throw0101a 7y agoCaching? More I/O? I would think that the speed that which most cores and instructions work at is often rarely the bottleneck nowadays for a good portion of workloads.
- derefr 7y ago> When you can put more transistors, you have to use them for something. I mean, it’d honestly be really interesting to know the performance charateristics (TDP et al) of an Intel 8088 if it were shrunk to 14nm and then driven at a modern clock speed. Maybe less is more?
- JoeAltmaier 7y agoHa, no. It didn't have cache, pipelining, separate bus and instruction subsystems, a wide bus. It would run one instruction every N clock cycles instead of N every 1 clock cycle, and hang on every memory read or write. Multi-byte math would take many instructions. It would be pathetic.
- dan_hawkins 7y agoIt would've been really bad compared to modern CPUs. Just one example: having no cache, instruction fetches would be slowed down to the speed of RAM, what's worse if that instruction writes/reads memory location then another RAM access would be issued, with high probability of accessing very different location additional timing penalties would occur (row pre-charge, etc.)
- Someone 7y agoOn the plus side, its entire address space (a whopping 1MB) could easily be on-chip, with the speed of a level 3 cache (Probably even a level 2 one). That CPU wouldn’t need RAM (it would be a fun exercise to write an OS that can run on a modern CPU without external RAM)
- woadwarrior01 7y agohttps://www.coreboot.org/data/yhlu/cache_as_ram_lb_09142006.pdf https://www.coreboot.org/data/yhlu/cache_as_ram_lb_09142006....
- david-gpu 7y ago> Maybe less is more? "Maybe thousands of computer architects are incompetent and don't realize there's no benefit from anything they've done in the past 40 years". Does that sound likely? Disclaimer: I'm one of those architects. Edit: I tried to "strel-man" your argument, but I couldn't see how.
- derefr 7y ago(It's "steel-man.") My argument isn't that modern software would run faster on such a CPU; my argument is instead that: 1. the most trivially-true version of the argument: software written for that CPU would run faster on a modern "remastering" of that CPU, than it would run (directly, via a lot of microcode-level emulation; or indirectly, via actual emulation) on a modern CPU. (Yes, some software that's still binary-forward-compatible with modern CPUs—only using generic ISA ops—would be faster on the modern CPU. But I'm talking about the worst, most persnickety edge-case uses of the ISA. The kinds of "requires a whole different model of the world to have the right side-effects" ops that make IBM write emulators for their previous mainframe architectures, rather than just shimming those ops into their new POWER ISAs and doing load-time static recompilation to the new ISA.) 2. smaller transistor size would mean less total power draw per cycle—i.e. it's a rather dim bulb—which means you could overclock the heck out of that CPU. 3. As long as you don't also make the die-size any smaller (but rather just lay out your small transistors with super-long trace-paths between them), then you're not decreasing the thermal surface-area of the die in the process, so you can then attach a modern cooling setup to it to clock it even higher. 4. Or, if you like, you can shrink the die-size and produce a compact 10nm 8088, at which point it'd probably be, say... 1 sq. mm? Smaller than a Cortex-M0+, for sure. That's the point when things are small enough that you can start to do wacky things like covering the entire (uncapped) die surface in a focused laser beam, to cool it by entangling the coherent "negative temperature" photons with the traces' positive-temperature baryons, as an indiscriminate version of an atomic-force microscope's method of ion capture.
- Someone 7y agoBut what would you do with that speed? Let’s say you run that 8088 at 10GHz (about a factor 1,000 faster than a fast 8088). What useful algorithm needs that speed but not more than 1MB memory (that CPU could read and write its entire address space a thousand times a second)?
- throwaway-9320 7y agoI remember reading somewhere that nowadays a significant chunk of the instructions isn't actually implemented on the CPU using transistors, but by using CPU microcode to sort of emulate these instructions by combining existing ones. Someone correct me if I'm wrong.
- Koshkin 7y agoThis is true. On the other hand, most of the transistors in the CPU are spent on memory (microcode and cache).
- gpderetta 7y agoThat's not really the case. Many complex, obsolete or not timing critical instructions are microcoded, but the large majority of instructions executed by the cpu are not. They are translated to microops, but that's a different thing, normally there is a single microop that executes the bulk of the instruction.
- jcranmer 7y agoMicro-ops are the actual things that can be executed by the hardware. A floating-point FMA unit is going to support a floating point addition, subtraction, fused multiply add (with various intermediate sign twiddles), and integer multiplication and wide multiplication--all without adding much more hardware: you're adding a few xors or muxes to the big, fat multiplier in the middle of it all. Each of these might have distinct micro-ops, or you might be able to separate the processing stages and use a single multiplier micro-op with distinct preprocessing micro-ops for the different instructions. Realistically, though, you are adding new micro-ops, although the overall hardware burden may be light. The motivation of adding new instructions is generally to get higher performance, so there's going to be pressure to have hardware to execute it well, as opposed to a more naive emulation. But sometimes people add support without making it fast--AMD chips used to (still do? I'm not sure) implement the 256-bit AVX instructions by sending the 128-bit halves through their units in sequence, so that it technically supported AVX instructions but didn't see any improved benefit from it.
- Symmetry 7y agoBack in the high CISC era every instruction would be backed by microcode as a series of instructions like "Load the first argument from memory location X; load the address of the second argument from memory location Y; now use that to get the second argument; store the result in memory location Z;" Then in the RISC era the instructions being fed to processors more closely matched what was going on inside, though pipelining made that a bit more complicated. These days a processor will still take the incoming instruction stream and sometimes break up instructions into pieces but it will also sometimes fuse two instructions into a single one like a compare followed by a branch.
- pjmlp 7y agoThat is why bytecode based executables are so nice. Sure you need an AOT compiler as part of the OS, or having a JIT as part of the runtime, but I rather let the compiler infer what might be the best to use, even if not optimal, than playing around with -march configurations. Something that mainframes have been doing since the 70's.
- saagarjha 7y agoWhich bytecode-based compilers actually perform real optimizations, aside from WebAssembly? Both Python and Java seem to emit "stupid" bytecode and let the JIT take care of it. (And any bytecode implementation is almost always slower than native code.)
- pjmlp 7y agoAll of those that are actually compiled to native code? Optimizations done at bytecode level aren't worthwhile unless you are targeting pure interpreters. Still, there are bytecode optimizers for Java and .NET, that is part of what code obfuscators are able to do, what many toolchains for embedded devices do as packing step, and a standard step in Android builds. In what concerns JIT/AOT themselves, well having bytecodes with a kernel JIT is what has allowed IBM and Unisys to update their hardware designs, while keeping software with several decades of history to keep running. It is also what allows Android and watchOS code to transition to 64 bits without most developers even having to care about it. Or how Android, Java and .NET developers are able to take advantage of AVX auto-vectorization, string SIMD, bits operation optimizations, without having to touch their decades old binaries. It also allows the usage of cloud compilers (UWP, Android, IBM J9), which gather PGO information across multiple deployments and use it as input to the top tier JIT/AOT optimizing compilers.
- the8472 7y agoThe instructions are certainly not free of cost, but they don't have to implement new function units for every new instruction. Often new instructions are just slightly different/more general modes of existing ones. And on the other side legacy instructions will be emulated via microcode instead of having dedicated units. The software equivalent would be compatibility shims and wrapper functions with different signatures sharing a common, highly parameterized internal implementation.
- londons_explore 7y agoI think we're a long long way from someone declaring that "we have found the best way to arrange the transistors - there are no further improvements to be made".
- yjftsjthsd-h 7y agoThat feels like an orthogonal issue. I mean, what if the best way to arrange the transistors turns out to be a one-instruction set computer? It's not obvious to me that adding more instructions is a better use of the transistors available in the surface area we've got to work with.
- londons_explore 7y agoMore instructions builds a slightly higher moat for new companies who think they might design a CPU, and adds a bit to AMD's costs to keep up. Customers who use those instructions will stick with intel for a generation or two until AMD comes out with something compatible, and if intel is smart, they'll contribute patches to opensource software projects which make use of them, and have some low performance fallback path for non-intel processors. As those instructions become part of the regular software ecosystem, other architectures like ARM will have to add something similar too, again increasing the cost of playing catchup.
- creato 7y agoThis may be true, but it is ridiculously cynical to think this is the main reason to add instructions to a processor. Every vendor I'm aware of for CPUs, GPUs, and other kinds of processors, are all adding instructions for ML workloads, and they often really do help a lot. Also, if you think that ARM and x86 have parity in support for instructions, you are off your rocker.
- api 7y agoCISC is basically a compression codec based on macros. Each macro encodes a batch of micro ops and core engineers are free to decide how to implement them for the best speed vs silicon trade off for each instruction. The thing that killed RISC (at least the true minimal kind) was the divergence of CPU and RAM speeds. All those instructions saturate the memory bus. Code density became important. X86 is of course a bit of a legacy mess, but the worst thing about it is not too many instructions but how many instruction widths there are. The X86 stream is hard to parse compared with ARM and others with only one or two instruction word sizes. A few ideas from RISC survived, and chief among them was fixed instruction widths, minimizing instruction dependencies, and canonical encodings. RISC-V is really not RISC in the original minimal sense, but it kept the moniker for those aspects. Adding more instructions (macros) to X64 will not make its downsides any worse. That being said, I do wonder if maybe X64 has so many because it is using them to work around the inefficiencies in its instruction encoding. Maybe some of these ops would be just as fast without a big macro if the core instruction set were less crufty, but I am not a CPU engineer.