ghc-9.2.2: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Cmm.Type

Synopsis

Documentation

data CmmType Source #

Instances

Instances details
Show CmmType Source # 
Instance details

Defined in GHC.Cmm.Type

Outputable CmmType Source # 
Instance details

Defined in GHC.Cmm.Type

Methods

ppr :: CmmType -> SDoc 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

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 #

(/=) :: Width -> Width -> Bool #

Ord Width Source # 
Instance details

Defined in GHC.Cmm.Type

Methods

compare :: Width -> Width -> Ordering #

(<) :: Width -> Width -> Bool #

(<=) :: Width -> Width -> Bool #

(>) :: Width -> Width -> Bool #

(>=) :: Width -> Width -> Bool #

max :: Width -> Width -> Width #

min :: Width -> Width -> Width #

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.

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

data ForeignHint Source #

Constructors

NoHint 
AddrHint 
SignedHint 

Instances

Instances details
Outputable ForeignHint Source # 
Instance details

Defined in GHC.Cmm.Ppr.Decl

Methods

ppr :: ForeignHint -> SDoc Source #

Eq ForeignHint Source # 
Instance details

Defined in GHC.Cmm.Type