GHC.CmmToAsm.X86.Cond

ghc-9.0.1: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.CmmToAsm.X86.Cond

Synopsis

- data Cond
  - = ALWAYS
  - | EQQ
  - | GE
  - | GEU
  - | GTT
  - | GU
  - | LE
  - | LEU
  - | LTT
  - | LU
  - | NE
  - | NEG
  - | POS
  - | CARRY
  - | OFLO
  - | PARITY
  - | NOTPARITY
- condToUnsigned :: Cond -> Cond
- maybeFlipCond :: Cond -> Maybe Cond
- maybeInvertCond :: Cond -> Maybe Cond

# Documentation

data Cond Source #

Constructors

ALWAYS |
EQQ |
GE |
GEU |
GTT |
GU |
LE |
LEU |
LTT |
LU |
NE |
NEG |
POS |
CARRY |
OFLO |
PARITY |
NOTPARITY |

#### Instances

Instances details

Eq Cond # |
Instance details Defined in GHC.CmmToAsm.X86.Cond Methods (==) :: Cond -> Cond -> Bool # (/=) :: Cond -> Cond -> Bool #

condToUnsigned :: Cond -> Cond Source #

maybeFlipCond :: Cond -> Maybe Cond Source #

`maybeFlipCond c` returns `Just c'` if it is possible to flip the arguments to the conditional `c`, and the new condition should be `c'`.

maybeInvertCond :: Cond -> Maybe Cond Source #

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.