3 ms·
Like I have said, except for the CDC 6600 and its successors, including Cray-1, which used register-register operations, I have meant that many early computers
by adrian_b 4y ago
Like I have said, except for the CDC 6600 and its successors, including Cray-1, which used register-register operations, I have meant that many early computers had a subset of the RISC features enumerated by you, i.e. fixed-length instructions, no microcode, and in some cases also pipelining (which before IBM Stretch introduced this word in 1959 was called overlapped execution). They also had simple addressing modes and a relatively small number of instructions.
Most of these characteristics were present in the first electronic computers made with vacuum tubes.
In time, the computers became more complex, so after about 15 years of evolution computers like the various IBM System/360 models had features like microcoded implementation, variable-length instruction encoding, register-memory operations, addressing modes with 3 components, many complex instructions for special purposes that were seldom used. All these features, which became standard around 1965, have been removed 10 years later in IBM 801, in order to enable a higher performance, by reverting a part of the evolution from the first 15 years of the electronic computers.
- kragen 4y agoCan you name one? You've named Stretch but presumably you're not trying to say Stretch was a RISC; and the Cray-1 was developed after the 801 and isn't much RISCier than the 6600, and even less simple. I admit I'm not very familiar with first- and second-generation CPU architectures, but the ones I have read about in any detail, like the LGP-30, the TX-0, and the IBM 1620, are very far from RISC.
- adrian_b 4y agoI am too lazy to search right now through the library, but there are plenty of books about the history of electronic computers, which describe some of the vacuum-tube computers of the fifties which introduced various innovations, e.g. the computers built by NBS (SEAC & SWAC), various IAS derivatives, the IBM scientific computing series starting with IBM 701, and many others. For some of the early computers there are manuals at bitsavers.org. All the early computers had by necessity features with low implementation cost, i.e. hardwired control, fixed-size instructions, simple addressing modes, low number of instructions, etc. The RISC CPUs returned to this simplicity, but they did not become completely similar with the early computers because the early computers did not have a large set of registers allowing the computations to be done by register-register operations. The early computers did not have many registers for 2 reasons, first they would have been too expensive when made with discrete components, and second there was no need for them because the memory access was fast in comparison with the instruction execution time. Nevertheless, the concept of an ISA separated in register-register computational instructions and load/store instructions for accessing the memory has also not been newly introduced by the RISC projects, but it dates back to the CDC 6600, in 1964, even if at that time having only 8 data registers was the reasonable register set size. So all the RISC recommendations had been used, for various reasons, in earlier computers. What was new with RISC, and this has appeared for the first time in the IBM 801 documentation, i.e. in 1975/1976, was the idea that by returning to the original simplicity of the older computers less hardware resources are needed to implement the CPU, and then the saved hardware resources can be used to implement other features that have a higher impact on performance, e.g. a larger register set, on-chip cache memory, faster parallel multipliers, and so on. The RISC approach was a more rational CPU design optimization methodology, which advocated the measurement of the complete performance impact of any new feature, e.g. an extra instruction or addressing mode added to the ISA, and the rejection of the features which add too much cost while providing too little performance increase or even a performance decrease, because the added feature might accelerate a seldom used application, while slowing down all the frequently used applications. The optimization approach proposed by RISC remains as correct today as in 1975 or 1980, but when different manufacturing technologies are available the optimum CPU design can be very different. While including certain instructions in the ISA might have been a bad choice in 1980, e.g. an extra instruction for computing the tensor product of 2 vectors, a performance vs. cost analysis done in 2020 might conclude that it is in fact the best change that could be done to an ISA in the given technology, in order to provide maximum additional performance at minimum additional cost. So what must be retained from RISC is not e.g. the necessity of having a fixed-length instruction encoding, or any other feature that was optimal in 1980, and which might happen to be still optimal in 2022, but this is not certain and it must be demonstrated by a new analysis, based on the current technological capabilities. What must be retained from RISC is that CPU design is an optimization problem and any features of a design must be justified by concrete performance and cost numbers, and not by vague ideas about what might be useful or not useful to have in a CPU. What is frustrating when looking at modern CPU or GPU designs, e.g. Zen 4, Raptor Lake or the RTX 4000 series, is that an outside observer cannot really assess whether the CPU or GPU design teams have done a good job or not. An outside observer can measure the performance, i.e. the speed and energy consumption of a CPU or GPU when performing certain tasks, but there is no access to the cost information, which is a closely guarded secret, because foundries like TSMC do not provide design rules information, unless you are a potential big customer. So an outsider cannot judge whether the current CPU and GPU architectures and micro-architectures are the best that can be done, or significant improvements are possible.
- brucehoult 4y agoI endorse this comment, in full. I'll only add that the CDC 6600 could get away with "only" 8 data registers (60 bits each) because those registers held only the floating point (usually) values being calculated on, while there were another 8 registers to hold memory addresses (18 bits each) AND another 8 registers to hold integer variables (also 18 bits) such as counters and array indexes and loop limits. So, it's actually a quite respectable 24 registers. Basically the same as the (relatively) modern 68000 series with 8 data registers, 8 address registers, and 8 FP registers.
- kragen 4y agoYeah, I can agree with it too. I still feel like it's cheating a little because of the non-orthogonality of the registers: you can only load X1–X5, you can only store X6–X7, and you can't store into A1–A7 without causing a load or a store (which, hey, saves you an instruction when you're indexing through an array). But I guess there's nothing particularly un-RISCy about having floating point multiply and divide but no integer multiply and divide. All this sounds an awful lot like someone designed a machine specifically to do two interleaved DGEMMs all the time. Why two? Maybe in order to hide the high latency of the heavily multibanked memory? A funny thing is that this separation of address registers from "decrement" registers (the integer variables you mention, which as I understand it actually number only 7 because one of them is the zero register, as on RISC-V) is faintly reminiscent of CHERI and even more so some of its predecessors, but of course the 6600 didn't attempt any sort of security with these. You might be aware lkcl is basing his LibreSOC on the 6600 (and, sadly, on POWER rather than RISC-V). It'll be interesting to see how it comes out; I think he's more enamored of the superscalar approach than the instruction set.
- kragen 4y agoHere's an example of the non-orthogonality. Here's a RISC-V loop that looks for a mismatch between two arrays of words (untested): loop: lw a0, (a3) # load array item from s1 lw a1, (a4) # and from s2 bne a0, a1, quit # and compare them; if they were equal, addi a3, a3, 4 # advance the s1 pointer addi a4, a4, 4 # and the s2 pointer bne a4, a5, loop # and repeat if we haven’t reached the end quit: That's 128 bits with C, and if the arrays are long, benefits hugely from even a fairly small instruction cache. I thought this would be more compact on the 6600 because incrementing the pointers also fetches from them, but this is the best I could come up with in my pidgin ASCENT: 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12 LOOP SA1 A1+1 .INCREMENT A1 BY 1 WORD, LOAD X1 SA2 A2+1 .LOAD X2 IX1 X1-X2 .COMPARE VALUES LOADED, LEAVING DIFF IN X1 NZ X1 QUIT .LEAVE LOOP IF X1 IS NOT ZERO SB1 A1-B2 .SUBTRACT LIMIT VALUE IN B2 FROM A1 POINTER NE B1 B0 LOOP .IF DIFFERENCE /= 0 (B0 IS 0) REPEAT QUIT I'm not sure this is actually correct (I think NZ does a floating-point zero test and IX1 computes a 60-bit integer subtraction) but even if it is, it's a disappointing result. It's still six instructions! And now they take up 180 bits instead of 128! (But that's probably mostly because the immediate arguments 1, 1, QUIT, and LOOP are all 18 bits; in RVC they're 8, 8, 11, and 11, and the jump offsets are PC-relative. More a question of RVC than orthogonality.) I was thinking I could just use NE, just like RISC-V uses bne, but noo. NE is only for increment registers like B₁ and B₀! You can't use NE to compare A₁ and B₂, or A₁ and A₀, or X₁ and X₀. So the non-orthogonality of the register set stole back all the expressiveness I was hoping for from it.
- brucehoult 4y agoA very important point which I have not seen anyone make is that RISC is not only about having simple instructions and implementation BUT ALSO doing that in a way that does not harm performance. The early simple computers also had very poor performance, not just in an absolute sense (of course they had primitive circuitry) but RELATIVE to the technology they used e.g. the delay needed to clock two values into two sets of latches (flip-flops), feed the output into a full-adder, then clock the result into another (or the same) set of flip-flops. How fast can that clock cycle be in the technology? Now take some fixed task and measure how many of those clock cycles it takes to complete it. The much-maligned Dhrystone will do. How many instructions are needed to complete the task? How many full-adder clock cycles in total do those instructions take? Modern RISC does a good job of minimising those clock cycles while using a small amount of hardware. The first computers used a lot more clock cycles. That applies to not only the first mainframes but also the first minicomputers and the first microprocessors. They were simple in a way that seriously hurt performance.