3 ms·
Hmm, that’s actually a very interesting viewpoint on inline assembly, and it’s certainly something that I think may be useful to have. That being said, the ergo
by saagarjha 6y ago
Hmm, that’s actually a very interesting viewpoint on inline assembly, and it’s certainly something that I think may be useful to have. That being said, the ergonomics of actually using it are still kind of poor, even putting aside the strange register names and such, since it’s obviously not really designed to do this. And the other concern I would have is that compilers tend to be fairly conservative when seeing such constructs; I think even with operands specified as much as possible there are still substantial gaps in what you can express to the compiler and also how much the compiler actually cares that you marked a particular register set as being clobbered-it might just spill more or be conservative if it doesn’t want to deal with your constraints. I should probably look to see if compilers treat it better today.
- jart 6y agoYou're not alone in feeling that way. There's a very short list of people who've ever taken the time to fully grok Richard Stallman's Math 55 assembly notation, and they mostly work on projects like the Linux Kernel and glibc. It's designed to do anything. I've been using it the past few days to retool the standard x86_64 compiler to generate 16-bit boot code for The LISP Challenge. https://github.com/jart/cosmopolitan/blob/b6793d42d5ed6b4f78ffdf61bf68931c8ca37b44/tool/build/emubin/lisp.real.c https://github.com/jart/cosmopolitan/blob/b6793d42d5ed6b4f78...