HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduleghc-10.0.0.20260917GHC2024

GHC.CmmToAsm.Instr

  • 1 type
  • 1 class
  • 1 value
classclass Instruction instr where
#

Common things that we can do with instructions, on all architectures. These are used by the shared parts of the native code generator, specifically the register allocators.

Methods

Instances6Instruction
  • Instruction InstrDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64 · orphan

    Instruction instance for aarch64

  • Instruction InstrDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.LA64 · orphan

    Instruction instance for LA64

  • Instruction InstrDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.PPC · orphan

    Instruction instance for powerpc

  • Instruction InstrDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.RV64 · orphan

    Instruction instance for RV64

  • Instruction InstrDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86 · orphan

    Instruction instance for x86 instruction set.

  • Instruction instr => Instruction (InstrSR instr)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Liveness
datadata RegUsage
#

Holds a list of source and destination registers used by a particular instruction.

Machine registers that are pre-allocated to stgRegs are filtered out, because they are uninteresting from a register allocation standpoint. (We wouldn't want them to end up on the free list!)

As far as we are concerned, the fixed registers simply don't exist (for allocation purposes, anyway).

Instances4Show, Outputable
  • Show RegUsageDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Instr
  • Outputable RegUsageDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.RV64.Instr · orphan
  • Outputable RegUsageDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.LA64.Instr · orphan
  • Outputable RegUsageDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.Instr · orphan

    Get the registers that are being used by this instruction. regUsage doesn't need to do any trickery for jumps and such. Just state precisely the regs read and written by that insn. The consequences of control flow transfers, as far as register allocation goes, are taken care of by the register allocator.

    RegUsage = RU [regs] [regs]