Well, I'm no expert on assembly and compiler writing, but if I were you, I would reduce the if statement to use just on je/jne.
Basically your example is build like this:
Code:
if (( boolean or boolean ) or boolean or (boolean and boolean)) {
...
}
There is no need to test every boolean when you can combine them with logical operations in to one single boolean and then test if that boolean is true or false.
Code:
( boolean or boolean ) or boolean or ( boolean and boolean)
=> boolean or boolean or boolean // 1st reduction
=> boolean // 2nd reduction
This of course means that you are making a full evaluation of the if expression. If you want lazy evaluation you will only need to make the 1st reduction (sequentially as needed) and then test on each boolean.
Bookmarks