mirror of
https://github.com/NaC-L/Mergen.git
synced 2026-05-12 09:40:34 +00:00
new test cases for branch solving
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
section .text
|
||||
|
||||
global main
|
||||
main:
|
||||
cmp rax, 0 ; zf = rax-0 == 0 ; sf = rax-0 < 0; of = (rax ^ 0) < 0; ....
|
||||
|
||||
jns cond_not_taken_sf ; sf == 0; if not taken, we can say rax is negative, so rax | 18446744073709551616 (sign bit is set)
|
||||
|
||||
condition_taken_sf: ; so the basic block here will assume rax's msb is set
|
||||
|
||||
shr rax, 63 ; rax will be 1
|
||||
|
||||
cond_not_taken_sf: ; but this basicblock wont assume rax is 0
|
||||
|
||||
ret
|
||||
@@ -0,0 +1,16 @@
|
||||
section .text
|
||||
|
||||
global main
|
||||
main:
|
||||
cmp rax, 0 ; zf = rax-0 == 0 ; sf = rax-0 < 0; of = (rax ^ 0) < 0; ....
|
||||
|
||||
jnz cond_not_taken_zf ; zf == 0; if not taken, we can say rax is 0 for this branch, we can do this by rax & 0.
|
||||
|
||||
condition_taken_zf: ; so the basic block here will assume rax is 0
|
||||
|
||||
inc rax ; rax will be 1
|
||||
|
||||
cond_not_taken_zf: ; but this basicblock wont assume rax is 0
|
||||
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user