18 -- | An immediate value.
19 -- Not all of these are directly representable by the machine.
20 -- Things like ImmLit are slurped out and put in a data segment instead.
28 -- AbstractC Label (with baggage)
37 | ImmConstantSum Imm Imm
38 | ImmConstantDiff Imm Imm
44 -- | Create a ImmLit containing this string.
45 strImmLit :: String -> Imm
46 strImmLit s = ImmLit (text s)
49 -- | Convert a CmmLit to an Imm.
50 -- Narrow to the width: a CmmInt might be out of
51 -- range, but we assume that ImmInteger only contains
52 -- in-range values. A signed value should be fine here.
54 litToImm :: CmmLit -> Imm
57 CmmInt i w -> ImmInteger (narrowS w i)
58 CmmFloat f W32 -> ImmFloat f
59 CmmFloat f W64 -> ImmDouble f
60 CmmLabel l -> ImmCLbl l
61 CmmLabelOff l off -> ImmIndex l off
63 CmmLabelDiffOff l1 l2 off
65 (ImmConstantDiff (ImmCLbl l1) (ImmCLbl l2))
68 CmmBlock id -> ImmCLbl (infoTblLbl id)
69 _ -> panic "SPARC.Regs.litToImm: no match"