Arithmetic
add rax, rbx ; rax = rax + rbx
sub rax, 4 ; rax = rax - 4
inc rcx ; rcx = rcx + 1
imul rax, rbx ; signed multiply
imul eax, ecx, 10 ; eax = ecx * 10
; multiply-by-constant tricks (faster than imul):
shl rax, 3 ; rax = rax * 8 (shift left by 3)
lea rax, [rax+rax*2] ; rax = rax * 3
- Arithmetic updates RFLAGS (ZF, SF, CF, OF).
- Compilers replace
* power-of-twowithshland small constants withleachains.