ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.CmmToAsm.Format

Description

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

TODO: Signed vs unsigned?

TODO: This module is currently 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
- intFormat :: Width -> Format
- floatFormat :: Width -> Format
- isIntFormat :: Format -> Bool
- isFloatFormat :: Format -> Bool
- cmmTypeFormat :: CmmType -> Format
- formatToWidth :: Format -> Width
- formatInBytes :: Format -> Int

# Documentation

data Format Source #

Constructors

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

#### Instances

Instances details

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

intFormat :: Width -> Format Source #

Get the integer format of this width.

floatFormat :: Width -> Format Source #

Get the float format of this width.

isIntFormat :: Format -> Bool Source #

Check if a format represent an integer value.

isFloatFormat :: Format -> Bool Source #

Check if a format represents a floating point value.

cmmTypeFormat :: CmmType -> Format Source #

Convert a Cmm type to a Format.

formatToWidth :: Format -> Width Source #

Get the Width of a Format.

formatInBytes :: Format -> Int Source #