moduleX86.Cond(Cond (..),condUnsigned ,condToSigned ,condToUnsigned ,maybeFlipCond ,maybeInvertCond )whereimportGhcPreludedataCond =ALWAYS -- What's really used? ToDo|EQQ |GE |GEU |GTT |GU |LE |LEU |LTT |LU |NE |NEG |POS |CARRY |OFLO |PARITY |NOTPARITY derivingEqcondUnsigned::Cond ->BoolcondUnsigned GU =TruecondUnsignedLU =TruecondUnsignedGEU =TruecondUnsignedLEU =TruecondUnsigned_=FalsecondToSigned::Cond ->Cond condToSigned GU =GTT condToSignedLU =LTT condToSignedGEU =GE condToSignedLEU =LE condToSignedx =x condToUnsigned::Cond ->Cond condToUnsigned GTT =GU condToUnsignedLTT =LU condToUnsignedGE =GEU condToUnsignedLE =LEU condToUnsignedx =x -- | @maybeFlipCond c@ returns @Just c'@ if it is possible to flip the-- arguments to the conditional @c@, and the new condition should be @c'@.maybeFlipCond::Cond ->MaybeCond maybeFlipCond cond =casecond ofEQQ ->JustEQQ NE ->JustNE LU ->JustGU GU ->JustLU LEU ->JustGEU GEU ->JustLEU LTT ->JustGTT GTT ->JustLTT LE ->JustGE GE ->JustLE _other ->Nothing-- | If we apply @maybeInvertCond@ to the condition of a jump we turn-- jumps taken into jumps not taken and vice versa.---- Careful! If the used comparison and the conditional jump-- don't match the above behaviour will NOT hold.-- When used for FP comparisons this does not consider unordered-- numbers.-- Also inverting twice might return a synonym for the original condition.maybeInvertCond::Cond ->MaybeCond maybeInvertCond cond =casecond ofALWAYS ->NothingEQQ ->JustNE NE ->JustEQQ NEG ->JustPOS POS ->JustNEG GEU ->JustLU LU ->JustGEU GE ->JustLTT LTT ->JustGE GTT ->JustLE LE ->JustGTT GU ->JustLEU LEU ->JustGU --GEU "==" NOTCARRY, they are synonyms--at the assembly levelCARRY ->JustGEU OFLO ->NothingPARITY ->JustNOTPARITY NOTPARITY ->JustPARITY 

AltStyle によって変換されたページ (->オリジナル) /