MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::plug::arm::Target Class Reference

The machine facts of the AArch64 backend; the ABI is AAPCS64. More...

#include <mim/plug/arm/target.h>

Inheritance diagram for mim::plug::arm::Target:
[legend]

Public Member Functions

 Target ()
bool is_flags (const Def *def) const final
bool is_sched_cc (const App *app) const final
 Is app the sched of the backend's cc?
size_t negate_cc (size_t c) const final
 The hardware encoding pairs each condition code with its negation in bit 0.
bool is_mem_insn (const App *app) const final
 Is app an instruction that takes the mem.M 0 it continues as its first argument?
size_t num_regs (Class cls) const final
bool reserved (Class cls, size_t r) const final
 Is r never available to register allocation?
bool caller_saved (Class cls, size_t r) const final
size_t num_arg_regs (Class cls) const final
size_t arg_reg (Class cls, size_t i) const final
 The register of the i-th argument of class cls.
size_t ret_reg (Class cls) const final
bool is_removable (const App *insn) const final
 May insn go if nothing uses its results, e.g.
Public Member Functions inherited from mim::plug::mach::Target
 Target (std::string_view name, plugin_t plugin)
 plugin is the backend's plugin id.
nat_t ptr_size () const override
 The size and alignment of a pointer in bytes; see core.trait.
size_t num_allocatable (Class cls) const
 The number of registers of cls that register allocation may assign.
size_t num_caller_saved (Class cls) const
 The number of those that a call may clobber.
const App * isa_sched_cc (const Def *cond) const
 The sched of a cc that yields cond, if any.
Class cls (const Def *def) const
virtual bool is_machine_insn (const App *app) const
 Is app an instruction of this backend, other than mach.sched, that belongs on a mem.M 0 chain?
bool is_insn (const App *app) const
 Is app an instruction that belongs on a mem.M 0 chain?
virtual Constraint constraint (const App *insn) const
 The register constraint of insn; by default, it has none.
virtual const App * untie (const App *, const DefSet &, const Def *) const
 An equivalent of insn that needs no copy of its tied operand if the values after the instruction hold it, or that ties the parameter phi which its result replaces at the block's jump; none if there is no better one.
virtual bool fits_imm (const Def *) const
 Does the literal lit fit a hole of type Want::Imm?
const Def * in (Class cls, size_t r, const Def *v) const
 The value v of class cls in register r.
const Def * prev_mem (const App *app) const
 The memory app continues, if app is an instruction on a mem.M 0 chain.
Public Member Functions inherited from mim::Target
 Target (std::string_view name)
virtual ~Target ()=default
std::string_view name () const
 The plugin name, used as the prefix of diagnostics.

Additional Inherited Members

Public Types inherited from mim::plug::mach::Target
enum  Class : size_t {
  Gpr ,
  Fpr ,
  Flags ,
  Stack ,
  Num_Classes
}
 The register classes; Stack values live in a spill slot and are unbounded. More...
Static Public Member Functions inherited from mim::plug::mach::Target
static const Target & of (Driver &driver)
 The Target of the one loaded backend; every backend's Target is a mach::Target.
static constexpr bool is_elf ()
static constexpr std::string_view global_prefix ()
 The prefix that the object format adds to a C symbol.
static constexpr std::string_view local_prefix ()
 The prefix of an assembler-local label.
static const Def * spill (const Def *type)
static const Def * reload (const Def *type)
 The instruction that reloads a value of type from its spill slot.
static const Def * spill_type (const Def *type)
 The type of the spill slot of a value of type.
static bool is_lowered (const Axm *axm)
 Is axm an operation that instruction selection must have replaced?
static DefVec operands (const App *insn)
 The operands of insn: the argument of a sched's instruction, otherwise the arguments including the memory.
static const Def * result (const App *insn, size_t j)
 The j-th projection of the non-memory result of insn.
static const App * rebuild (const App *insn, const Def *m, const DefVec &ops)
 insn continuing m with ops instead of its operands.
static bool is_in (const Def *def)
static size_t in_reg (const Def *inin)
 The register r of in r v.
static bool is_view (const Def *def)
 Is def a zext d v, which reads v's register?
static const Def * unview (const Def *def)
 The v of zext d v, otherwise def.
static const Def * strip (const Def *def)
 The v of in r v, zext d v, or zext d (in r v), otherwise def.
static const Def * sched_insn (const App *app)
static bool is_mem (const Def *def)

Detailed Description

The machine facts of the AArch64 backend; the ABI is AAPCS64.

Definition at line 10 of file target.h.

Constructor & Destructor Documentation

◆ Target()

mim::plug::arm::Target::Target ( )
inline

Definition at line 12 of file target.h.

References Target().

Referenced by Target().

Member Function Documentation

◆ arg_reg()

size_t mim::plug::arm::Target::arg_reg ( Class cls,
size_t i ) const
inlinefinalvirtual

The register of the i-th argument of class cls.

Implements mim::plug::mach::Target.

Definition at line 36 of file target.h.

References mim::plug::arm::Arg_Regs, mim::plug::mach::Target::cls(), mim::plug::arm::Fpr_Arg_Regs, and mim::plug::mach::Target::Gpr.

◆ caller_saved()

bool mim::plug::arm::Target::caller_saved ( Class cls,
size_t r ) const
inlinefinalvirtual

◆ is_flags()

bool mim::plug::arm::Target::is_flags ( const Def * def) const
inlinefinalvirtual

Is def a Flags value or a condition tested on one, neither of which is a register value?

Implements mim::plug::mach::Target.

Definition at line 15 of file target.h.

References mim::Axm::isa().

◆ is_mem_insn()

bool mim::plug::arm::Target::is_mem_insn ( const App * app) const
inlinefinalvirtual

Is app an instruction that takes the mem.M 0 it continues as its first argument?

mach.slot; a backend adds its loads and stores.

Reimplemented from mim::plug::mach::Target.

Definition at line 23 of file target.h.

References mim::plug::mach::Target::is_mem_insn(), and mim::Axm::isa().

◆ is_removable()

bool mim::plug::arm::Target::is_removable ( const App * insn) const
inlinefinalvirtual

May insn go if nothing uses its results, e.g.

a load? A mach.sched and mach.slot; a backend adds its loads.

Reimplemented from mim::plug::mach::Target.

Definition at line 39 of file target.h.

References mim::plug::mach::Target::is_removable(), and mim::Axm::isa().

◆ is_sched_cc()

bool mim::plug::arm::Target::is_sched_cc ( const App * app) const
inlinefinalvirtual

Is app the sched of the backend's cc?

Implements mim::plug::mach::Target.

Definition at line 16 of file target.h.

References mim::Axm::isa(), and mim::plug::mach::Target::sched_insn().

◆ negate_cc()

size_t mim::plug::arm::Target::negate_cc ( size_t c) const
inlinefinalvirtual

The hardware encoding pairs each condition code with its negation in bit 0.

Implements mim::plug::mach::Target.

Definition at line 20 of file target.h.

◆ num_arg_regs()

size_t mim::plug::arm::Target::num_arg_regs ( Class cls) const
inlinefinalvirtual

◆ num_regs()

size_t mim::plug::arm::Target::num_regs ( Class cls) const
inlinefinalvirtual

◆ reserved()

bool mim::plug::arm::Target::reserved ( Class cls,
size_t r ) const
inlinefinalvirtual

Is r never available to register allocation?

Implements mim::plug::mach::Target.

Definition at line 29 of file target.h.

References mim::plug::mach::Target::cls(), mim::plug::mach::Target::Fpr, mim::plug::arm::Fpr_Scratch, and mim::plug::arm::reserved().

◆ ret_reg()

size_t mim::plug::arm::Target::ret_reg ( Class cls) const
inlinefinalvirtual

The documentation for this class was generated from the following file: