This is non-sequitor, I know, but thought I'd contribute for informational purposes.
BigEd wrote:
MichaelM wrote:
Similarly, the RISC-like 16-bit Inmos Transputer did not have a carry flag (or processor status register), and doing higher precision (32-bit or more) arithmetic was a bit difficult
Well, well - you are quite right. I hadn't realised that. The same is true of the modern RISC-V architecture, which comes in 32-bit and 64-bit flavours - multi-word arithmetic being less crucial on a wider machine. On an 8-bit machine it's essential.
(It turns out that the high level language Occam for the Transputer provided functions for wide arithmetic.)
Multi-precision arithmetic is still possible and with acceptable overhead as if you had an explicit carry bit (remember, these instructions are all single-cycle if you use an in-order, single-pipeline CPU, and faster on wider dispatching architectures):
Code:
add x1, x2, x3 ; Add low half
add x4, x5, x6 ; Add high half
slt x7, x1, x2 ; X7 = 1 iff X1 < X2, else 0 (IOW, the carry bit)
add x4, x4, x7 ; Accumulate the carry.
The reason the RISC-V lacks any CPU flags what-so-ever is that, frankly, flags are complicated in anything that isn't a single-issue, in-order CPU. They require
every instruction to have an implicit register dependency (your flags) which takes a fair amount of logic to work around to get high performance.
I think one of the reasons why Intel CPUs beat the Motorola 68K series once superscalar architectures became a thing is because, if you look at x86 instruction semantics, not all instructions touch flags like Motorola's did. The POWER architecture works around this by having a "flags queue", where each instruction that is allowed to update flags will set CC0, thus bumping its former contents to CC1, CC2, etc. I think there are 8 CCs on a 32-bit architecture. If you need to branch on a CC, you must explicitly specify which CC you're interested in testing. (If you've read about the Mill CPU, this should sound familiar; Mill CPU does the same sort of thing to all intermediate computations, not just the flags.)