ghc-lib-parser-9.12.2.20250421: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Cmm.Type

Synopsis

- data CmmType
- b8 :: CmmType
- b16 :: CmmType
- b32 :: CmmType
- b64 :: CmmType
- b128 :: CmmType
- b256 :: CmmType
- b512 :: CmmType
- f32 :: CmmType
- f64 :: CmmType
- bWord :: Platform -> CmmType
- bHalfWord :: Platform -> CmmType
- gcWord :: Platform -> CmmType
- cInt :: Platform -> CmmType
- cmmBits :: Width -> CmmType
- cmmFloat :: Width -> CmmType
- typeWidth :: CmmType -> Width
- setCmmTypeWidth :: Width -> CmmType -> CmmType
- cmmEqType :: CmmType -> CmmType -> Bool
- cmmCompatType :: CmmType -> CmmType -> Bool
- isFloatType :: CmmType -> Bool
- isGcPtrType :: CmmType -> Bool
- isBitsType :: CmmType -> Bool
- isWordAny :: CmmType -> Bool
- isWord32 :: CmmType -> Bool
- isWord64 :: CmmType -> Bool
- isFloat64 :: CmmType -> Bool
- isFloat32 :: CmmType -> Bool
- data Width
  - = W8
  - | W16
  - | W32
  - | W64
  - | W128
  - | W256
  - | W512
- widthInBits :: Width -> Int
- widthInBytes :: Width -> Int
- widthInLog :: Width -> Int
- widthFromBytes :: Int -> Width
- wordWidth :: Platform -> Width
- halfWordWidth :: Platform -> Width
- cIntWidth :: Platform -> Width
- halfWordMask :: Platform -> Integer
- narrowU :: Width -> Integer -> Integer
- narrowS :: Width -> Integer -> Integer
- rEP_CostCentreStack_mem_alloc :: Platform -> CmmType
- rEP_CostCentreStack_scc_count :: Platform -> CmmType
- rEP_StgEntCounter_allocs :: Platform -> CmmType
- rEP_StgEntCounter_allocd :: Platform -> CmmType
- data ForeignHint
  - = NoHint
  - | AddrHint
  - | SignedHint
- type Length = Int
- vec :: Length -> CmmType -> CmmType
- vec2 :: CmmType -> CmmType
- vec4 :: CmmType -> CmmType
- vec8 :: CmmType -> CmmType
- vec16 :: CmmType -> CmmType
- vec2f64 :: CmmType
- vec2b64 :: CmmType
- vec4f32 :: CmmType
- vec4b32 :: CmmType
- vec8b16 :: CmmType
- vec16b8 :: CmmType
- cmmVec :: Int -> CmmType -> CmmType
- vecLength :: CmmType -> Length
- vecElemType :: CmmType -> CmmType
- isVecType :: CmmType -> Bool
- type DoAlignSanitisation = Bool

# Documentation

data CmmType Source #

#### Instances

Instances details

Show CmmType Source # |
Instance details Defined in GHC.Cmm.Type Methods showsPrec :: Int -> CmmType -> ShowS Source # show :: CmmType -> String Source # showList :: [CmmType] -> ShowS Source #
Outputable CmmType Source # |
Instance details Defined in GHC.Cmm.Type Methods ppr :: CmmType -> SDoc Source #

b8 :: CmmType Source #

b16 :: CmmType Source #

b32 :: CmmType Source #

b64 :: CmmType Source #

b128 :: CmmType Source #

b256 :: CmmType Source #

b512 :: CmmType Source #

f32 :: CmmType Source #

f64 :: CmmType Source #

bWord :: Platform -> CmmType Source #

bHalfWord :: Platform -> CmmType Source #

gcWord :: Platform -> CmmType Source #

cInt :: Platform -> CmmType Source #

cmmBits :: Width -> CmmType Source #

cmmFloat :: Width -> CmmType Source #

typeWidth :: CmmType -> Width Source #

setCmmTypeWidth :: Width -> CmmType -> CmmType Source #

cmmEqType :: CmmType -> CmmType -> Bool Source #

cmmCompatType :: CmmType -> CmmType -> Bool Source #

A weaker notion of equality of `CmmType`s than `cmmEqType`, used (only) in Cmm Lint.

Why "weaker"? Because:

- we don't distinguish GcPtr vs NonGcPtr, because the the RTS files are not yet well-typed wrt pointers,
- for vectors, we only compare the widths, because in practice things like X86 xmm registers support different types of data (e.g. 4xf32, 2xf64, 2xu64 etc).

isFloatType :: CmmType -> Bool Source #

isGcPtrType :: CmmType -> Bool Source #

isBitsType :: CmmType -> Bool Source #

isWordAny :: CmmType -> Bool Source #

isWord32 :: CmmType -> Bool Source #

isWord64 :: CmmType -> Bool Source #

isFloat64 :: CmmType -> Bool Source #

isFloat32 :: CmmType -> Bool Source #

data Width Source #

Constructors

W8 |
W16 |
W32 |
W64 |
W128 |
W256 |
W512 |

#### Instances

Instances details

Show Width Source # |
Instance details Defined in GHC.Cmm.Type Methods showsPrec :: Int -> Width -> ShowS Source # show :: Width -> String Source # showList :: [Width] -> ShowS Source #
Outputable Width Source # |
Instance details Defined in GHC.Cmm.Type Methods ppr :: Width -> SDoc Source #
Eq Width Source # |
Instance details Defined in GHC.Cmm.Type Methods (==) :: Width -> Width -> Bool Source # (/=) :: Width -> Width -> Bool Source #
Ord Width Source # |
Instance details Defined in GHC.Cmm.Type Methods compare :: Width -> Width -> Ordering Source # (<) :: Width -> Width -> Bool Source # (<=) :: Width -> Width -> Bool Source # (>) :: Width -> Width -> Bool Source # (>=) :: Width -> Width -> Bool Source # max :: Width -> Width -> Width Source # min :: Width -> Width -> Width Source #

widthInBits :: Width -> Int Source #

A width in bits.

widthInBytes :: Width -> Int Source #

A width in bytes.

    widthFromBytes (widthInBytes w) === w

widthInLog :: Width -> Int Source #

log_2 of the width in bytes, useful for generating shifts.

widthFromBytes :: Int -> Width Source #

- Partial* A width from the number of bytes.

wordWidth :: Platform -> Width Source #

The width of the current platform's word size.

halfWordWidth :: Platform -> Width Source #

The width of the current platform's half-word size.

cIntWidth :: Platform -> Width Source #

halfWordMask :: Platform -> Integer Source #

A bit-mask for the lower half-word of current platform.

narrowU :: Width -> Integer -> Integer Source #

Narrow a signed or unsigned value to the given width. The result will reside in `[0, +2^width)`.

    >>> narrowU W8 256    == 256
    >>> narrowU W8 255    == 255
    >>> narrowU W8 128    == 128
    >>> narrowU W8 127    == 127
    >>> narrowU W8 0      == 0
    >>> narrowU W8 (-127) == 129
    >>> narrowU W8 (-128) == 128
    >>> narrowU W8 (-129) == 127
    >>> narrowU W8 (-255) == 1
    >>> narrowU W8 (-256) == 0

narrowS :: Width -> Integer -> Integer Source #

Narrow a signed value to the given width. The result will reside in `[-2^(width-1), +2^(width-1))`.

    >>> narrowS W8 256    == 0
    >>> narrowS W8 255    == -1
    >>> narrowS W8 128    == -128
    >>> narrowS W8 127    == 127
    >>> narrowS W8 0      == 0
    >>> narrowS W8 (-127) == -127
    >>> narrowS W8 (-128) == -128
    >>> narrowS W8 (-129) == 127
    >>> narrowS W8 (-255) == 1
    >>> narrowS W8 (-256) == 0

rEP_CostCentreStack_mem_alloc :: Platform -> CmmType Source #

rEP_CostCentreStack_scc_count :: Platform -> CmmType Source #

rEP_StgEntCounter_allocs :: Platform -> CmmType Source #

rEP_StgEntCounter_allocd :: Platform -> CmmType Source #

data ForeignHint Source #

Constructors

NoHint |
AddrHint |
SignedHint |

#### Instances

Instances details

Outputable ForeignHint Source # |
Instance details Defined in GHC.Cmm.Type Methods ppr :: ForeignHint -> SDoc Source #
Eq ForeignHint Source # |
Instance details Defined in GHC.Cmm.Type Methods (==) :: ForeignHint -> ForeignHint -> Bool Source # (/=) :: ForeignHint -> ForeignHint -> Bool Source #

type Length = Int Source #

vec :: Length -> CmmType -> CmmType Source #

vec2 :: CmmType -> CmmType Source #

vec4 :: CmmType -> CmmType Source #

vec8 :: CmmType -> CmmType Source #

vec16 :: CmmType -> CmmType Source #

vec2f64 :: CmmType Source #

vec2b64 :: CmmType Source #

vec4f32 :: CmmType Source #

vec4b32 :: CmmType Source #

vec8b16 :: CmmType Source #

vec16b8 :: CmmType Source #

cmmVec :: Int -> CmmType -> CmmType Source #

vecLength :: CmmType -> Length Source #

vecElemType :: CmmType -> CmmType Source #

isVecType :: CmmType -> Bool Source #

type DoAlignSanitisation = Bool Source #

is `-falignment-sanitisation` enabled?