SPARC.Imm

ghc-8.4.4: The GHC API

Safe Haskell | None
Language | Haskell2010

SPARC.Imm

Synopsis

- data Imm
  - = ImmInt Int
  - | ImmInteger Integer
  - | ImmCLbl CLabel
  - | ImmLit SDoc
  - | ImmIndex CLabel Int
  - | ImmFloat Rational
  - | ImmDouble Rational
  - | ImmConstantSum Imm Imm
  - | ImmConstantDiff Imm Imm
  - | LO Imm
  - | HI Imm
- strImmLit :: String -> Imm
- litToImm :: CmmLit -> Imm

# Documentation

data Imm #

An immediate value. Not all of these are directly representable by the machine. Things like ImmLit are slurped out and put in a data segment instead.

Constructors

ImmInt Int |
ImmInteger Integer |
ImmCLbl CLabel |
ImmLit SDoc |
ImmIndex CLabel Int |
ImmFloat Rational |
ImmDouble Rational |
ImmConstantSum Imm Imm |
ImmConstantDiff Imm Imm |
LO Imm |
HI Imm |

strImmLit :: String -> Imm #

Create a ImmLit containing this string.

litToImm :: CmmLit -> Imm #

Convert a CmmLit to an Imm. Narrow to the width: a CmmInt might be out of range, but we assume that ImmInteger only contains in-range values. A signed value should be fine here.