Size

ghc-7.6.3: The GHC API

Safe Haskell | None

Size

Description

Sizes on this architecture A Size is a combination of width and class

TODO: Rename this to Format instead of Size to reflect the fact that it represents floating point vs integer.

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 Size
  - = II8
  - | II16
  - | II32
  - | II64
  - | FF32
  - | FF64
  - | FF80
- intSize :: Width -> Size
- floatSize :: Width -> Size
- isFloatSize :: Size -> Bool
- cmmTypeSize :: CmmType -> Size
- sizeToWidth :: Size -> Width
- sizeInBytes :: Size -> Int

# Documentation

data Size

Constructors

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

Instances

Eq Size |
Show Size |

intSize :: Width -> Size

Get the integer size of this width.

floatSize :: Width -> Size

Get the float size of this width.

isFloatSize :: Size -> Bool

Check if a size represents a floating point value.

cmmTypeSize :: CmmType -> Size

Convert a Cmm type to a Size.

sizeToWidth :: Size -> Width

Get the Width of a Size.

sizeInBytes :: Size -> Int