3 ms·
The poor souls having to deal with that c++ monstruosity which is LLVM for legac y support in the RISC-V world have my sympathy. The RISC-V world was made most
by sylware 3y ago
The poor souls having to deal with that c++ monstruosity which is LLVM for legac y support in the RISC-V world have my sympathy.
The RISC-V world was made mostly for assembly written software (without abusing a preprocessor, namely trying to write c++ or even C with a preprocessor...). That because it is a world wide standard, free from royalties and licencing (not like arm and intel).
- remexre 3y agoIn what way is RISC-V more suited for writing assembly than, say, AArch64? From what I know of each, they're fairly close together, but a few small things like the clever encoding of logical immediates (e.g. and x1, x1, 0x3fff70000000 is a single instruction; you don't need to waste a register to load the immediate) in AArch64 make it seem friendlier to me.
- cmrdporcupine 3y ago100%. RISC-V at least requires a macro assembler of some kind to be more pleasant. That's not to say RISC-V isn't a good ISA. The whole point of RISC is to be a good target for compilation, not humans.
- sylware 3y agoI severely disagree, I think that a "good enough" and "free" and world-wide ISA standard is meant for assembly programming. I meant a lot more, like all system components and very high level language interpreters (javascript/lua/python/insert_your_high_level_language_here). I did not mean zero preprocessor, I meant a conservative/frugal usage a simple pre-processor to avoid to spawn another insanely complex SDK dependency of the code which will be a pain to create a real life alternative. Basically, RISC-V is meant for multi-instructions per line assemblers (semi-colon...).
- snvzz 3y agoThere's no real reason to code in machine code, or to give up the convenience of a macro assembler and use a micro assembler. But you can do both with RISC-V, there's nothing to stop you.
- cmrdporcupine 3y agoAbsolutely, and I've done it. But as far as various assemblers go, RISC-V is one of the least ergonomic. It's consistent, certainly. But tedious.
- snvzz 3y agoI have done it, too. RISC-V Feels like MIPS, except better. m68k used to be my favorite, until RISC-V happened.
- pjmlp 3y agoTraditional with the MIPS CPU linage, as many instructions common in other ISAs, only exist as macros.
- snvzz 3y ago>In what way is RISC-V more suited for writing assembly than, say, AArch64? Not them, but I would say it's backwards compatibility guaranteed for RV64GC, which happens to be very nice and clean, free of the baggage other ISAs have.
- sylware 3y agoaarch64 is not a world-wide free standard. You have acquire a licence from arm if you want to create cpu support aarch64. That's what apple is doing. The licence fee is only valid in some countries though.
- rwmj 3y ago> The RISC-V world was made mostly for assembly written software I can assure you this is not the case. In fact RISC-V is somewhat annoying to write software for directly in assembly because of the lack of support for loading large constants (directly), and making large jumps.
- sylware 3y agoI don't agree. It is fine if you use a multi-instructions-per-line assembler.
- trealira 3y agoWhy is that different from "abusing a preprocessor"? Because it's built into the assembler?
- sylware 3y agoThe preprocessor can be independent from the assembler. For instance when I code x86_64 assembly I use a C preprocessor (and I am not doing weird things with it)... but I use 3 assemblers (fasmg/nasm/gas), I still use their internal preprocessor, but hardly, only to smooth their syntax to have only 1 source file I can assemble with fasmg/nasm/gas. The main issue with a "preprocessor" it is when it's ultra complex and powerful, for instance with fasmg and to a lesser extend nasm: devs are literaly jerking off using as much as possible the complexity of the preprocessor, making their assembly code hardly assembly anymore, and you end up having to learn their whole new language they did built with it, and the really annoying thing their "assembly" code becomes strongely dependent on that specific preprocessor and the "technical exit cost" is astronomical. This is no better than to depend on a c++ compiler.
- trealira 3y agoI guess that makes sense. RISC-V assembly doesn't actually seem that difficult to hand write, especially given that pseudo-instructions exist. I don't see why you wouldn't just write in C, though, aside from a few functions where hand-written assembly is necessary. C compilers are more complex than assemblers, but they're still really common and, and they're doable for the average person to learn to write on their own.