3 ms·
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 sel
by flohofwoe 3y ago
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).
- gpderetta 3y agoYou can copy a flag in the al register then add that. That's usually what the compiler generates.
- flohofwoe 3y agoAlso, apparently ARM64 did drop the conditional instructions (somehow I missed the memo): https://offlinemark.com/2023/07/29/til-arm64-doesnt-include-conditional-instructions/ https://offlinemark.com/2023/07/29/til-arm64-doesnt-include-...