3 ms·
> The inline assembly is not idiomatic. Today you should be using register asm. Who's writing these idioms? I've always seen register variables as an alternati
by LegionMammal978 2y ago
> The inline assembly is not idiomatic. Today you should be using register asm.
Who's writing these idioms? I've always seen register variables as an alternative, not the default option, except for those registers which have no constraint code.
- fuhsnn 2y agoProbably the current state that GCC for Aarch64 and RISC-V simply don't offer individual register constraints like x86.
- fwsgonzo 2y agoRegister variables are idiomatic when you're locking down every single register anyway, which is always the case for system calls. If you're writing assembly where you want the register allocators help, by all means use regular inline assembly.
- Joker_vD 2y agoDoesn't GCC have long-standing bugs where it a) doesn't support assigning some select registers, and b) when you try to use them anyway, it instead completely ignores your annotations with no diagnostics, and c) when it gets reported on GCC's bug tracker, a maintainer would reply with "well, it's always been like that and everyone knows you can't use this register like that anyway" and close it as WONTFIX? I distinctly remember reading about something like that...
- fwsgonzo 2y agoPerhaps, but I can't imagine its buggy for general registers like those used in system calls. I haven't seen that bug, but I don't doubt it. There's many obscure registers for various architectures that could bug out.