From: Tony Harminc Sent: Sunday, 17 February 2013 11:17 AM
On 15 February 2013 21:33, Robin Vowels <[email protected]> wrote:
The S/360 is clearly definitely and unequivocably a CISC machine. Think of instructions like ED, EDMK, TR, TRT, PACK, UNPK, CVB, CVD, and of course all the decimal arithmetic instructions, all the character move and compare instructions (except the immediate instructions). Then there are the shift instructions, whose times depend on the number of positions to be shifted; the floating-point instructions, which pre- and/or post-normalize (except for Halve); multiply and divide instructions. Then for the S/370, instructions like MVCL and CLCL were added.
One might better think of the mix of instruction encountered in a real world instruction stream. ED and EDMK form a minuscule fraction of all instructions executed, and even in a commercial environment, the packed decimal instructions (including CVB, CVD, PACK, and UNPK) form a very small portion. Indeed only the RR and RX instructions (and their modern counterparts) show up on any sort of ordinary graph of instruction use, and all others can go in the "other" bucket.
Some think that instruction frequency counts are the measure of the usefulness of instructions. But first, you have overlooked the CISC-style instructions of the S/360. I did not restrict that classification to just ED, EDMK, etc, but also to RR and RX instructions like shift, multiply, divide, the floating-point instructions that involve pre- and post-normalization (and in particular but not restricted to multiply and divide), decimal instructions, and most of the character instructions. Using simple instruction counts tells nothing. Take the TRT instruction, for example. To search for a single character in, say, a string of length 256, requires one TR instruction. To do the same without TR, requires a loop of several instructions. Multiply that by the number of iterations (up to 256) thus could require the execution of up to 1024 instructions. Given the choice, which would you use? The TR instruction for this task runs in a fraction (perhaps 1/10th) of the time of the loop. Given a list of characters to search for, TR romps home in anything from 1/20-th to 1/100-th of the time of the loop method. Thus, to make a reasonable comparison of instruction frequencies, one must use a weighted comparison, counting, say, 10 to 100, or even 1000 times for each TR instruction, depending on what it is searching for. Similarly for the other CISC-type instructions, like decimal, which you dispense to the "other" bucket.
Certainly S/360 and S/370 are CISC machines from a time long predating the terms RISC and CISC. But for practical purposes (such as compiler writing or performance analysis) rather than academic taxonomy, they may as well be RISC.
They are very definitely nothing like RISC. RISC machines attempt to execute each instruction in one machine cycle. That tends to restrict the range of instructions that can be implemented on such a machine. Such instruction sets would include integer operations for load, add, subtract, compare, store, shift one place (though more places could be handled in a single machine cycle), branch. However, the instruction set wouldn't include such luxuries as multiply, divide, etc.
