Format

ghc-8.4.4: The GHC API

Safe Haskell | None
Language | Haskell2010

Format

Description

Formats on this architecture A Format is a combination of width and class

TODO: Signed vs unsigned?

TODO: This module is currenly shared by all architectures because NCGMonad need to know about it to make a VReg. It would be better to have architecture specific formats, and do the overloading properly. eg SPARC doesn't care about FF80.

Synopsis

- data Format
  - = II8
  - | II16
  - | II32
  - | II64
  - | FF32
  - | FF64
  - | FF80
- intFormat :: Width -> Format
- floatFormat :: Width -> Format
- isFloatFormat :: Format -> Bool
- cmmTypeFormat :: CmmType -> Format
- formatToWidth :: Format -> Width
- formatInBytes :: Format -> Int

# Documentation

data Format #

Constructors

II8 |
II16 |
II32 |
II64 |
FF32 |
FF64 |
FF80 |

Instances

Eq Format # |
Instance details Defined in Format Methods (==) :: Format -> Format -> Bool # (/=) :: Format -> Format -> Bool #
Show Format # |
Instance details Defined in Format Methods showsPrec :: Int -> Format -> ShowS Source # show :: Format -> String Source # showList :: [Format] -> ShowS Source #

intFormat :: Width -> Format #

Get the integer format of this width.

floatFormat :: Width -> Format #

Get the float format of this width.

isFloatFormat :: Format -> Bool #

Check if a format represents a floating point value.

cmmTypeFormat :: CmmType -> Format #

Convert a Cmm type to a Format.

formatToWidth :: Format -> Width #

Get the Width of a Format.

formatInBytes :: Format -> Int #