Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Setting the CPU flag after a comparison doesn't do anything useful yet, you also need to perform an addition with 1 or do nothing depending on the flag, and selecting between these two options is usually done with a conditional branch, unless the CPU can execute ALU instructions conditionally (ARM can do this, x86 only has conditional mov AFAIK).


You can copy a flag in the al register then add that. That's usually what the compiler generates.


Also, apparently ARM64 did drop the conditional instructions (somehow I missed the memo):

https://offlinemark.com/2023/07/29/til-arm64-doesnt-include-...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: