ghc-9.12.0.20241128: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.Cmm.Type

Synopsis

Documentation

data CmmType Source #

Instances

Instances details
Outputable CmmType Source # 
Instance details

Defined in GHC.Cmm.Type

Methods

ppr :: CmmType -> SDoc Source #

Show CmmType Source # 
Instance details

Defined in GHC.Cmm.Type

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

A weaker notion of equality of CmmTypes 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).

data Width Source #

Constructors

W8 
W16 
W32 
W64 
W128 
W256 
W512 

Instances

Instances details
Outputable Width Source # 
Instance details

Defined in GHC.Cmm.Type

Methods

ppr :: Width -> SDoc Source #

Show Width Source # 
Instance details

Defined in GHC.Cmm.Type

Methods

showsPrec :: Int -> Width -> ShowS #

show :: Width -> String #

showList :: [Width] -> ShowS #

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.Type

Methods

ppr :: ForeignHint -> SDoc Source #

Eq ForeignHint Source # 
Instance details

Defined in GHC.Cmm.Type

type DoAlignSanitisation = Bool Source #

is -falignment-sanitisation enabled?