logoalt Hacker News

WalterBrightlast Wednesday at 5:18 PM2 repliesview on HN

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!


Replies

fuhsnnlast Wednesday at 8:57 PM

This post was very helpful when I tried to figure it out: https://dougallj.wordpress.com/2021/10/30/bit-twiddling-opti...

show 1 reply
vardumplast Wednesday at 8:36 PM

I expect a sufficiently good macro assembler should be able to do it as well.

show 1 reply