News for hackers. Stuff that matters.
Re:Machine Code Isn't Scary by WalterBright on Wednesday June 04, 2025 @01:18PM (#44183102)
Sometimes you don't really want to write in assembler. Like loading a constant into a register for the AArch64. The instructions to do it are pretty wacky, and it's hard to see if you wrote the correct combination to load the value. Best to let the compiler do it for you (or use godbolt.org! to get the right mix). The same for floating point constants.

Once I got the code sequences for this right on my AArch64 code generator, I don't have to ever figure it out again!

Re:Machine Code Isn't Scary by vardump on Wednesday June 04, 2025 @04:36PM (#44185213)
I expect a sufficiently good macro assembler should be able to do it as well.
Re:Machine Code Isn't Scary by WalterBright on Wednesday June 04, 2025 @06:12PM (#44186097)
Then you might as well use a HLL.
Re:Machine Code Isn't Scary by fuhsnn on Wednesday June 04, 2025 @04:57PM (#44185466)
This post was very helpful when I tried to figure it out: https://dougallj.wordpress.com/2021/10/30/bit-twiddling-opti...
Re:Machine Code Isn't Scary by WalterBright on Wednesday June 04, 2025 @08:31PM (#44187115)
I could have used that during the hours I spent figuring it out!