5 ms·
ARM: Pragmatism, Not Purity
- torstenvl 4y agoI had the same experience. In college we used 32-bit SPARC for our assembly course, and I loved everything about it. I was hoping ARM would be similarly elegant, but when I toyed with it I felt like it wasn't something I was ever going to be able to truly "think in."
- acegopher 4y agoSounds like a wonderful college experience. SPARCs are nice... I was a little before that, our assembly language course was 68000, which was a nice step up from 6502 I was familiar with. But I do love RISCs. I am curious what were the main things you liked about SPARC and disliked about ARM?
- snvzz 4y agoMine used MIPS. It sure varies depending on university. These days, RISC-V seems to be quickly gaining terrain in academia.
- chasil 4y agoAdmiration for SPARC and MIPS is not universal, and there were interesting warts on these early designs that did not age well. https://www.jwhitham.org//2016/02/risc-instruction-sets-i-have-known-and.html https://www.jwhitham.org//2016/02/risc-instruction-sets-i-ha... https://news.ycombinator.com/item?id=11607119 https://news.ycombinator.com/item?id=11607119
- snvzz 4y agoThey get many mentions in early RISC-V rationale and even the spec itself. There were reasons not to use these architectures, even when/if open.
- chasil 4y agoMIPS and SPARC blew everybody out of the water at their introduction, but they sacrificed elements of the instruction set for immediate/generational performance gains. "RISC II proved to be much more successful in silicon and in testing outperformed almost all minicomputers on almost all tasks. For instance, performance ranged from 85% of VAX speed to 256% on a variety of loads. RISC II was also benched against the famous Motorola 68000, then considered to be the best commercial chip implementation, and outperformed it by 140% to 420%." https://en.wikipedia.org/wiki/Berkeley_RISC https://en.wikipedia.org/wiki/Berkeley_RISC [Not really much mention of MIPS performance relative to CISC minis.] https://en.wikipedia.org/wiki/Stanford_MIPS https://en.wikipedia.org/wiki/Stanford_MIPS https://en.wikipedia.org/wiki/R2000_microprocessor https://en.wikipedia.org/wiki/R2000_microprocessor
- torstenvl 4y agoPredictable pipelining and delay slots were easy to adjust to and understand, and I love the idea of a rotating register file with zero-copy call stack, even though it's impractical today. The author claims memorizing how the registers overwrite one another is complicated, but I don't think so at all. G registers are global (with g0 always being 0). L registers are local. I (input) registers are the interface with the caller, O (output registers) are the interface with the callee, and the overlapping register window just moves so that O registers are I registers in the called function. Elegant. Also the author goes on to praise x86, which is absolutely fucking bananas if you care about not having to rote memorize register names. I'm calling a function with four word-sized arguments. In SPARC they go in %o0, %o1, %o2, and %o3. Where do they go in x86?
- ZirconiumX 4y agoDIre SIlicon DeXtrously Concatenates 8 and 9 (for SysV). Jubilee[1] came up with that and it's a useful mnemonic. [1]: https://twitter.com/workingjubilee https://twitter.com/workingjubilee
- talideon 4y agoARM64 or ARM26/32? Because they're quite different beasts. The original ARM ISA was designed with the idea that people would and could write software directly in it. ARM64 was not.
- acegopher 4y agoI'm not familiar with ARM64. What about it makes it hard to write assembly in it? Is this also true of ARM32 or RISC-V?
- bmitc 4y agoWhat about compared to RISC-V?
- saagarjha 4y agoLeans towards cleaner in my experience.
- als0 4y agoNot if you add the extensions.
- snvzz 4y agoMore pragmatic _and_ RISC-er.
- gpderetta 4y agoIs it more pragmatic? Their stance is basically 'instruction fusion will fix everything'.
- GoOnThenDoTell 4y agoDoes it fix everything?
- gpderetta 4y agoSure, given a Sufficiently Smart Decoder.
- less_less 4y agoNo, of course. It'd be interesting to see how much you can claw back with a practical implementation though. Off the top of my head, it's not practical to fix RISCV's multi-precision arithmetic issues with instruction fusion. That's not a dominant use-case, especially if post-quantum crypto takes off, but it's definitely a place where RISCV underperforms ARM and x86 by a large factor instruction-for-instruction. Also there are places where ARM's instructions improve code density, like LDMIA, STMDB etc. These of course can't be fixed by fusion. I'm sure there are other areas.
- deleted 4y ago[deleted]
- klelatti 4y agoI think this was true of the original ARM architecture too. Interesting talk on the history of the architecture, including 64-bit, from Arm's lead architect [1] [1] https://soundcloud.com/university-of-cambridge/a-history-of-the-arm-architecture-and-the-lessons-learned-while-building-it https://soundcloud.com/university-of-cambridge/a-history-of-...
- talideon 4y agoThat's not the case at all. Some elements of the original ARM ISA were carried over (such as the barrel shifter - they were an influence from VLIW architectures, and a common enough task to justify their inclusion), but many of the ergonomic elements were ditched. It was significantly more parsimonious, but some elements, such as having the flags in the PC/R15 and conditional execution for all instructions were later scrapped for various reasons.
- KurvaKing 4y ago
- klelatti 4y agoNot 100% sure what you're pushing back against here. It was certainly a pragmatic implementation of RISC when compared to other designs of the era which were much more 'pure.
- talideon 4y agoI'm not pushing back against anything. The ARM ISA family has two distinct phases. I'm just stating that the original ISA and the current ISA are two distinct beasts. Both are pragmatic in their own way, but the motivations between how that pragmatism is applied are quite different.
- klelatti 4y ago> Both are pragmatic in their own way Which is exactly what my comment was intended to imply. Nothing else.
- jdefr89 4y agoI thought I was the only one… I find ARM to be quite cumbersome and odd. I wouldn’t call it RISC by any means when it comes down the pragmatists, at least not in the traditional sense. I think its popularity stemmed from its energy efficiency rather than elegance…
- iamflimflam1 4y agoI think like everything, over time more and more has been added. The original instruction set was very minimal and felt very RISC.
- nine_k 4y agoRISC is great for implementation and programming simplicity. But these are not the only variables one optimizes a core for. The higher-end the implementation, the more internally complex or special-case extensions it may include, from AES acceleration instructions to signed pointers. ARM's popularity also stems from its licensing, AFAICT. You can license various ARM cores, from the tiniest to the beefiest, to include in your SOC or MCU, mix and match them on the die, etc. This is not true for any reasonably recent x86 architecture, either from Intel or from AMD.
- zozbot234 4y agoInterestingly, AMD64 has had signed pointers since the start: valid 64-bit virtual addresses are always derived by sign extension, even when the actual virtual address space is smaller than 64 bits. This avoids compatibility issues with future implementations supporting larger address spaces.
- kennethh 4y agoI programmed a bit of ARM2 on the Archimedes personal computer around 1991. Coming from the Amiga 500 and 68000 assembly it was relatively easy to program on the ARM. Everything was 32 bit, only general registers and more of them. Also very nice that all instructions had conditional possibility. It was also insanely fast at the time even with only 8Mhz CPU.
- api 4y ago> It now feels like the real benefit that A64 ISA has is the fact that the instructions are all 4 bytes in size, which makes it much easier to implement wide frontends4 - coincidentally this of course seems to be where all the irregularities come from, as you effectively need to devise an encoding that makes it possible to unambiguously encode a large set of instructions and as much data as possible in some of them. That's not pragmatism per se. It's purity, but optimizing for something else: wide front ends and dense code to minimize memory overhead. Those are the right things to optimize for on a modern chip. Somewhat complicated decodes are fine as long as you don't have to do crazy things to guess the width of instructions like you do on x64.
- zozbot234 4y agoEven with something as clean as RISC-V, you still need a serial computation to determine insn boundaries. Yes it's a whole lot cleaner than x86-64, but in principle very wide insn decode might still be affected.
- snvzz 4y agoRISC-V instruction length is in the first two bits of every instruction; 3 of 4 values mean the instruction is 16-bit, the remaining value is for 32-bit. The complexity this adds to decode is a far cry from the brute-force approach x86 requires. This negligible impact is weighted against the benefits of higher code density; RISC-V is the most dense ISA, for 32 and 64 bit. ARM's AARCH64 does in contrast have exceptionally poor code density for a 64bit architecture. This translates in much higher requirements for cache sizes and ROM size, which in turn mean larger area and higher power consumption for a given performance target.
- chrisseaton 4y ago'A64' is a crazy way to abbreviate - as the other main architecture is AMD64, so also 'A64'!
- Gravityloss 4y agoAMD was founded in 1969 while Arm in 1991. Advanced Micro Devices vs Advanced RISC Machines... some inspiration perhaps?
- klelatti 4y agoWell ARM was originally Acorn Risc Machines so they had to choose something that started with A!
- kramerger 4y agoI believe the official name is aarch64
- Liquid_Fire 4y agoOfficially, AArch64 is the name of the 64-bit execution state. The instruction set is called A64, to contrast it with the pre-v8 instruction sets A32 and T32 (formerly known as Arm and Thumb). That said, in practice many people use them interchangeably since A64 is the only instruction set available in AArch64.
- Symmetry 4y agoI think it's not an accident that the two most successful ISAs today are x86, one of the simplest of the CISC ISAs, and Arm which was the most complicated of the RISC architectures. Arm 64 has reduced that complexity somewhat by getting rid of things like universal predication but they've still got instructions that, e.g., store or load two registers in a single instruction.
- AnimalMuppet 4y agoUm, what CISC ISAs do you think are more complicated than x86?
- Symmetry 4y agoI'm going from John Mashey's famous Usenet post on the issue. https://userpages.umbc.edu/~vijay/mashey.on.risc.html https://userpages.umbc.edu/~vijay/mashey.on.risc.html So that would be things like Vax that not only have load-store opps, they also have things like indirect loads and stores in a single operation.
- klelatti 4y agoS/360 and it’s successors
- fanf2 4y agoS/360 is also a relatively simple CISC. The more complex ones (many mem-mem instructions with fancy addressing modes) are VAX, 68020, NS32000.