codegen: add general SETcc instruction
SETcc instructions are used for fetching comparison results from the
FLAGS register and putting them into general registers, i.e. converting
a comparison result into a boolean value.
codegen: fix if-stmt asm
Previously the CMP used the EAX register while boolean operations
only set AL, using SETcc instructions. This meant that the upper 24-bits
may hold garbage values and munge the CMP result.
this fixes some correctness issues with the if-stmt and future comparison operators, as the assembly was in general incorrect here.
ftr I removed the calling fix and moved it to another branch. this one now just contains the if-stmt fix and SETcc instruction bits (cause it's a little wonky).
codegen: add general SETcc instruction SETcc instructions are used for fetching comparison results from the FLAGS register and putting them into general registers, i.e. converting a comparison result into a boolean value.
codegen: fix if-stmt asm Previously the CMP used the EAX register while boolean operations only set AL, using SETcc instructions. This meant that the upper 24-bits may hold garbage values and munge the CMP result.
this fixes some correctness issues with the if-stmt and future comparison operators, as the assembly was in general incorrect here.