r/AskComputerScience • u/petroleus • May 06 '25
What are the elements of a "good" instruction set architecture?
It's not hard to find a lot of ISA examples online, that's true, but design notes are obviously infinitely rarer. Assuming that someone would come to you expressing a desire to create a new ISA, what would your design suggestions* be? What would be, in your or someone else's opinion, good guidelines towards choosing what is included in and excluded from a new ISA?
* of course, excluding the suggestion to not do it :P
Thank you in advance!
4
Upvotes
8
u/DamienTheUnbeliever May 06 '25
If you haven't looked already, RISC-V is interesting because they clearly set out to create an ISA appropriate to both teaching and production; and they try to provide the justifying rationales for large decisions.
1
u/DawnOnTheEdge May 07 '25 edited May 07 '25
What are the requirements of your ISA? Usually you want one that’s some combination of:
You also care about constraints like how many address and data lines your CPU will need to support.
That said, most modern general-purpose ISAs are RISC architectures with 32-bit instruction words, 31 general-purpose registers plus a zero register, and a half-dozen or more instruction formats of which the most-used has two source registers and one destination register, which then add extensions for IEEE 754 floating-point math and SIMD. If your instruction fetches are going to be some multiple of 32 bits wide, that set of trade-offs makes the most sense.
1
u/AlexTaradov May 06 '25
There is not a single thing you can point to. Usually you need to define basic principles and you have a lot of freedom here. Then you need to start compiling some real high level code and observe what common sequences may be improved by having dedicated instructions. Add those.
Having orthogonal ISA is always good, but there will always be things that won't let that happen with reasonable encoding density.
Instruction sets are also rarely a real problem, the whole CPU architecture plays much bigger role in what feels good to program.