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

The ARM Plugin More...

Namespaces

namespace  insn
 Machine facts about the instructions of the arm plugin, shared by arm_isel.gen and the backend.
namespace  rules

Classes

class  Emit
 Writes GNU assembler code (AArch64 syntax) for the scheduled world; see AsmEmit for the output file. More...
struct  Reg
 A physical register of a register class. More...
struct  Src
 The source of a copy: a register or a literal; reg.cls is the class of either. More...
class  Target
 The machine facts of the AArch64 backend; the ABI is AAPCS64. More...

Enumerations

<tt>arm.reg</tt>
enum class  reg : flags_t {
  x0 = 0x933800000000000 ,
  x1 = 0x933800000000001 ,
  x2 = 0x933800000000002 ,
  x3 = 0x933800000000003 ,
  x4 = 0x933800000000004 ,
  x5 = 0x933800000000005 ,
  x6 = 0x933800000000006 ,
  x7 = 0x933800000000007 ,
  x8 = 0x933800000000008 ,
  x9 = 0x933800000000009 ,
  x10 = 0x93380000000000a ,
  x11 = 0x93380000000000b ,
  x12 = 0x93380000000000c ,
  x13 = 0x93380000000000d ,
  x14 = 0x93380000000000e ,
  x15 = 0x93380000000000f ,
  x16 = 0x933800000000010 ,
  x17 = 0x933800000000011 ,
  x18 = 0x933800000000012 ,
  x19 = 0x933800000000013 ,
  x20 = 0x933800000000014 ,
  x21 = 0x933800000000015 ,
  x22 = 0x933800000000016 ,
  x23 = 0x933800000000017 ,
  x24 = 0x933800000000018 ,
  x25 = 0x933800000000019 ,
  x26 = 0x93380000000001a ,
  x27 = 0x93380000000001b ,
  x28 = 0x93380000000001c ,
  x29 = 0x93380000000001d ,
  x30 = 0x93380000000001e
}
<tt>arm.fpr</tt>
enum class  fpr : flags_t {
  d0 = 0x933800000000100 ,
  d1 = 0x933800000000101 ,
  d2 = 0x933800000000102 ,
  d3 = 0x933800000000103 ,
  d4 = 0x933800000000104 ,
  d5 = 0x933800000000105 ,
  d6 = 0x933800000000106 ,
  d7 = 0x933800000000107 ,
  d8 = 0x933800000000108 ,
  d9 = 0x933800000000109 ,
  d10 = 0x93380000000010a ,
  d11 = 0x93380000000010b ,
  d12 = 0x93380000000010c ,
  d13 = 0x93380000000010d ,
  d14 = 0x93380000000010e ,
  d15 = 0x93380000000010f ,
  d16 = 0x933800000000110 ,
  d17 = 0x933800000000111 ,
  d18 = 0x933800000000112 ,
  d19 = 0x933800000000113 ,
  d20 = 0x933800000000114 ,
  d21 = 0x933800000000115 ,
  d22 = 0x933800000000116 ,
  d23 = 0x933800000000117 ,
  d24 = 0x933800000000118 ,
  d25 = 0x933800000000119 ,
  d26 = 0x93380000000011a ,
  d27 = 0x93380000000011b ,
  d28 = 0x93380000000011c ,
  d29 = 0x93380000000011d ,
  d30 = 0x93380000000011e ,
  d31 = 0x93380000000011f
}
<tt>arm.load</tt>
enum class  load : flags_t
<tt>arm.store</tt>
enum class  store : flags_t
<tt>arm.add</tt>
enum class  add : flags_t
<tt>arm.sub</tt>
enum class  sub : flags_t
<tt>arm.and</tt>
enum class  and_ : flags_t
<tt>arm.or</tt>
enum class  or_ : flags_t
<tt>arm.xor</tt>
enum class  xor_ : flags_t
<tt>arm.mul</tt>
enum class  mul : flags_t
<tt>arm.madd</tt>
enum class  madd : flags_t
<tt>arm.shl</tt>
enum class  shl : flags_t
<tt>arm.shr</tt>
enum class  shr : flags_t
<tt>arm.sar</tt>
enum class  sar : flags_t
<tt>arm.udiv</tt>
enum class  udiv : flags_t
<tt>arm.sdiv</tt>
enum class  sdiv : flags_t
<tt>arm.cmp</tt>
enum class  cmp : flags_t
<tt>arm.cc</tt>
enum class  cc : flags_t {
  eq = 0x933800000001600 ,
  ne = 0x933800000001601 ,
  cs = 0x933800000001602 ,
  cc = 0x933800000001603 ,
  mi = 0x933800000001604 ,
  pl = 0x933800000001605 ,
  vs = 0x933800000001606 ,
  vc = 0x933800000001607 ,
  hi = 0x933800000001608 ,
  ls = 0x933800000001609 ,
  ge = 0x93380000000160a ,
  lt = 0x93380000000160b ,
  gt = 0x93380000000160c ,
  le = 0x93380000000160d ,
  al = 0x93380000000160e ,
  nv = 0x93380000000160f
}
<tt>arm.fmov</tt>
enum class  fmov : flags_t
<tt>arm.fload</tt>
enum class  fload : flags_t
<tt>arm.fstore</tt>
enum class  fstore : flags_t
<tt>arm.fadd</tt>
enum class  fadd : flags_t
<tt>arm.fsub</tt>
enum class  fsub : flags_t
<tt>arm.fmul</tt>
enum class  fmul : flags_t
<tt>arm.fdiv</tt>
enum class  fdiv : flags_t
<tt>arm.fsqrt</tt>
enum class  fsqrt : flags_t
<tt>arm.fabs</tt>
enum class  fabs : flags_t
<tt>arm.fcmp</tt>
enum class  fcmp : flags_t
<tt>arm.i2f</tt>
enum class  i2f : flags_t
<tt>arm.u2f</tt>
enum class  u2f : flags_t
<tt>arm.f2i</tt>
enum class  f2i : flags_t
<tt>arm.f2u</tt>
enum class  f2u : flags_t
<tt>arm.f2f</tt>
enum class  f2f : flags_t
<tt>arm.isel</tt>
enum class  isel : flags_t
<tt>arm.emit</tt>
enum class  emit : flags_t

Functions

constexpr bool reserved (size_t r)
 x16/x17/x18 are the scratch and platform registers, x29/x30 the frame pointer and link register.
constexpr bool caller_saved_fpr (size_t r)
 AAPCS64: d8–d15 are callee-saved.
template<class Sel>
constexpr flags_t cc_to (cc c)
 The instance of the select family Sel (csel or fcsel) that selects on c.
void register_normalizers (Normalizers &normalizers)
template<class Reg>
constexpr size_t encoding (Reg r)
 The hardware encoding of the register r of a backend's module reg, whose subtags are in encoding order.

Variables

constexpr size_t Num_Regs = Annex::num<reg>()
constexpr size_t Num_Fpr = Annex::num<fpr>()
constexpr std::array< size_t, 8 > Arg_Regs
 AAPCS64: arguments in x0 … x7, result in x0.
constexpr size_t Ret_Reg = encoding(reg::x0)
constexpr bool Caller_Saved [Num_Regs]
constexpr std::array< size_t, 8 > Fpr_Arg_Regs
 AAPCS64: floating-point arguments in d0 … d7, result in d0.
constexpr size_t Ret_Fpr = encoding(fpr::d0)
constexpr size_t Fpr_Scratch = encoding(fpr::d31)
 d31 breaks a copy cycle, so allocation leaves it alone.
static constexpr plugin_t Plugin_Id = 0x933800000000000

<tt>arm.sext</tt>

enum class  sext : flags_t
const Def * normalize_sext (const Def *type, const Def *, const Def *x)

<tt>arm.trunc</tt>

enum class  trunc : flags_t
const Def * normalize_trunc (const Def *type, const Def *, const Def *x)

<tt>arm.zero</tt>

enum class  zero : flags_t
const Def * normalize_zero (const Def *type, const Def *, const Def *x)

<tt>arm.csel</tt>

enum class  csel : flags_t {
  eq = 0x933800000001400 ,
  ne = 0x933800000001401 ,
  cs = 0x933800000001402 ,
  cc = 0x933800000001403 ,
  mi = 0x933800000001404 ,
  pl = 0x933800000001405 ,
  vs = 0x933800000001406 ,
  vc = 0x933800000001407 ,
  hi = 0x933800000001408 ,
  ls = 0x933800000001409 ,
  ge = 0x93380000000140a ,
  lt = 0x93380000000140b ,
  gt = 0x93380000000140c ,
  le = 0x93380000000140d ,
  al = 0x93380000000140e ,
  nv = 0x93380000000140f
}
template<csel id>
const Def * normalize_csel (const Def *type, const Def *, const Def *arg)

<tt>arm.fcsel</tt>

enum class  fcsel : flags_t {
  eq = 0x933800000001500 ,
  ne = 0x933800000001501 ,
  cs = 0x933800000001502 ,
  cc = 0x933800000001503 ,
  mi = 0x933800000001504 ,
  pl = 0x933800000001505 ,
  vs = 0x933800000001506 ,
  vc = 0x933800000001507 ,
  hi = 0x933800000001508 ,
  ls = 0x933800000001509 ,
  ge = 0x93380000000150a ,
  lt = 0x93380000000150b ,
  gt = 0x93380000000150c ,
  le = 0x93380000000150d ,
  al = 0x93380000000150e ,
  nv = 0x93380000000150f
}
template<fcsel id>
const Def * normalize_fcsel (const Def *type, const Def *, const Def *arg)

Detailed Description


Class Documentation

◆ mim::plug::arm::Src

struct mim::plug::arm::Src

The source of a copy: a register or a literal; reg.cls is the class of either.

Definition at line 32 of file emit.h.

Class Members
const Def * imm = nullptr
Reg reg = {}

Enumeration Type Documentation

◆ add

enum class mim::plug::arm::add : flags_t
strong

Definition at line 105 of file autogen.h.

◆ and_

enum class mim::plug::arm::and_ : flags_t
strong

Definition at line 119 of file autogen.h.

◆ cc

enum class mim::plug::arm::cc : flags_t
strong
Enumerator
eq 
ne 
cs 
cc 
mi 
pl 
vs 
vc 
hi 
ls 
ge 
lt 
gt 
le 
al 
nv 

Definition at line 272 of file autogen.h.

◆ cmp

enum class mim::plug::arm::cmp : flags_t
strong

Definition at line 213 of file autogen.h.

◆ csel

enum class mim::plug::arm::csel : flags_t
strong
Enumerator
eq 
ne 
cs 
cc 
mi 
pl 
vs 
vc 
hi 
ls 
ge 
lt 
gt 
le 
al 
nv 

Definition at line 220 of file autogen.h.

◆ emit

enum class mim::plug::arm::emit : flags_t
strong

Definition at line 407 of file autogen.h.

◆ f2f

enum class mim::plug::arm::f2f : flags_t
strong

Definition at line 393 of file autogen.h.

◆ f2i

enum class mim::plug::arm::f2i : flags_t
strong

Definition at line 379 of file autogen.h.

◆ f2u

enum class mim::plug::arm::f2u : flags_t
strong

Definition at line 386 of file autogen.h.

◆ fabs

enum class mim::plug::arm::fabs : flags_t
strong

Definition at line 351 of file autogen.h.

◆ fadd

enum class mim::plug::arm::fadd : flags_t
strong

Definition at line 316 of file autogen.h.

◆ fcmp

enum class mim::plug::arm::fcmp : flags_t
strong

Definition at line 358 of file autogen.h.

◆ fcsel

enum class mim::plug::arm::fcsel : flags_t
strong
Enumerator
eq 
ne 
cs 
cc 
mi 
pl 
vs 
vc 
hi 
ls 
ge 
lt 
gt 
le 
al 
nv 

Definition at line 246 of file autogen.h.

◆ fdiv

enum class mim::plug::arm::fdiv : flags_t
strong

Definition at line 337 of file autogen.h.

◆ fload

enum class mim::plug::arm::fload : flags_t
strong

Definition at line 302 of file autogen.h.

◆ fmov

enum class mim::plug::arm::fmov : flags_t
strong

Definition at line 295 of file autogen.h.

◆ fmul

enum class mim::plug::arm::fmul : flags_t
strong

Definition at line 330 of file autogen.h.

◆ fpr

enum class mim::plug::arm::fpr : flags_t
strong
Enumerator
d0 
d1 
d2 
d3 
d4 
d5 
d6 
d7 
d8 
d9 
d10 
d11 
d12 
d13 
d14 
d15 
d16 
d17 
d18 
d19 
d20 
d21 
d22 
d23 
d24 
d25 
d26 
d27 
d28 
d29 
d30 
d31 

Definition at line 52 of file autogen.h.

◆ fsqrt

enum class mim::plug::arm::fsqrt : flags_t
strong

Definition at line 344 of file autogen.h.

◆ fstore

enum class mim::plug::arm::fstore : flags_t
strong

Definition at line 309 of file autogen.h.

◆ fsub

enum class mim::plug::arm::fsub : flags_t
strong

Definition at line 323 of file autogen.h.

◆ i2f

enum class mim::plug::arm::i2f : flags_t
strong

Definition at line 365 of file autogen.h.

◆ isel

enum class mim::plug::arm::isel : flags_t
strong

Definition at line 400 of file autogen.h.

◆ load

enum class mim::plug::arm::load : flags_t
strong

Definition at line 91 of file autogen.h.

◆ madd

enum class mim::plug::arm::madd : flags_t
strong

Definition at line 147 of file autogen.h.

◆ mul

enum class mim::plug::arm::mul : flags_t
strong

Definition at line 140 of file autogen.h.

◆ or_

enum class mim::plug::arm::or_ : flags_t
strong

Definition at line 126 of file autogen.h.

◆ reg

enum class mim::plug::arm::reg : flags_t
strong
Enumerator
x0 
x1 
x2 
x3 
x4 
x5 
x6 
x7 
x8 
x9 
x10 
x11 
x12 
x13 
x14 
x15 
x16 
x17 
x18 
x19 
x20 
x21 
x22 
x23 
x24 
x25 
x26 
x27 
x28 
x29 
x30 

Definition at line 14 of file autogen.h.

◆ sar

enum class mim::plug::arm::sar : flags_t
strong

Definition at line 168 of file autogen.h.

◆ sdiv

enum class mim::plug::arm::sdiv : flags_t
strong

Definition at line 182 of file autogen.h.

◆ sext

enum class mim::plug::arm::sext : flags_t
strong

Definition at line 189 of file autogen.h.

◆ shl

enum class mim::plug::arm::shl : flags_t
strong

Definition at line 154 of file autogen.h.

◆ shr

enum class mim::plug::arm::shr : flags_t
strong

Definition at line 161 of file autogen.h.

◆ store

enum class mim::plug::arm::store : flags_t
strong

Definition at line 98 of file autogen.h.

◆ sub

enum class mim::plug::arm::sub : flags_t
strong

Definition at line 112 of file autogen.h.

◆ trunc

enum class mim::plug::arm::trunc : flags_t
strong

Definition at line 197 of file autogen.h.

◆ u2f

enum class mim::plug::arm::u2f : flags_t
strong

Definition at line 372 of file autogen.h.

◆ udiv

enum class mim::plug::arm::udiv : flags_t
strong

Definition at line 175 of file autogen.h.

◆ xor_

enum class mim::plug::arm::xor_ : flags_t
strong

Definition at line 133 of file autogen.h.

◆ zero

enum class mim::plug::arm::zero : flags_t
strong

Definition at line 205 of file autogen.h.

Function Documentation

◆ caller_saved_fpr()

bool mim::plug::arm::caller_saved_fpr ( size_t r)
constexpr

AAPCS64: d8–d15 are callee-saved.

Definition at line 48 of file arm.h.

References caller_saved_fpr(), d15, d8, and encoding().

Referenced by mim::plug::arm::Target::caller_saved(), and caller_saved_fpr().

◆ cc_to()

template<class Sel>
flags_t mim::plug::arm::cc_to ( cc c)
constexpr

The instance of the select family Sel (csel or fcsel) that selects on c.

Definition at line 52 of file arm.h.

References mim::Annex::Base, cc_to(), and mim::Annex::flags2sub().

Referenced by cc_to().

◆ encoding()

template<class Reg>
size_t mim::plug::mach::encoding ( Reg r)
constexpr

The hardware encoding of the register r of a backend's module reg, whose subtags are in encoding order.

Definition at line 15 of file mach.h.

Referenced by caller_saved_fpr(), and reserved().

◆ normalize_csel()

template<csel id>
const Def * mim::plug::arm::normalize_csel ( const Def * type,
const Def * ,
const Def * arg )

Definition at line 34 of file normalizers.cpp.

References normalize_csel().

Referenced by normalize_csel().

◆ normalize_fcsel()

template<fcsel id>
const Def * mim::plug::arm::normalize_fcsel ( const Def * type,
const Def * ,
const Def * arg )

Definition at line 39 of file normalizers.cpp.

References normalize_fcsel().

Referenced by normalize_fcsel().

◆ normalize_sext()

const Def * mim::plug::arm::normalize_sext ( const Def * type,
const Def * ,
const Def * x )

Definition at line 30 of file normalizers.cpp.

References mim::plug::mach::fold_ext(), and normalize_sext().

Referenced by normalize_sext().

◆ normalize_trunc()

const Def * mim::plug::arm::normalize_trunc ( const Def * type,
const Def * ,
const Def * x )

Definition at line 31 of file normalizers.cpp.

References mim::plug::mach::fold_ext(), and normalize_trunc().

Referenced by normalize_trunc().

◆ normalize_zero()

const Def * mim::plug::arm::normalize_zero ( const Def * type,
const Def * ,
const Def * x )

Definition at line 29 of file normalizers.cpp.

References mim::plug::mach::fold_ext(), and normalize_zero().

Referenced by normalize_zero().

◆ register_normalizers()

void mim::plug::arm::register_normalizers ( Normalizers & normalizers)

◆ reserved()

bool mim::plug::arm::reserved ( size_t r)
constexpr

x16/x17/x18 are the scratch and platform registers, x29/x30 the frame pointer and link register.

Definition at line 34 of file arm.h.

References encoding(), reserved(), x16, x17, x18, x29, and x30.

Referenced by reserved(), and mim::plug::arm::Target::reserved().

Variable Documentation

◆ Arg_Regs

std::array<size_t, 8> mim::plug::arm::Arg_Regs
constexpr
Initial value:
= {
}
constexpr size_t encoding(Reg r)
The hardware encoding of the register r of a backend's module reg, whose subtags are in encoding orde...
Definition mach.h:15

AAPCS64: arguments in x0 … x7, result in x0.

Definition at line 20 of file arm.h.

Referenced by mim::plug::arm::Target::arg_reg(), and mim::plug::arm::Target::num_arg_regs().

◆ Caller_Saved

bool mim::plug::arm::Caller_Saved[Num_Regs]
constexpr
Initial value:
= {
true, true, true, true, true, true, true, true,
true, true, true, true, true, true, true, true,
false, false, false,
false, false, false, false, false, false, false, false, false, false,
false, false,
}

Definition at line 26 of file arm.h.

Referenced by mim::plug::arm::Target::caller_saved().

◆ Fpr_Arg_Regs

std::array<size_t, 8> mim::plug::arm::Fpr_Arg_Regs
constexpr

◆ Fpr_Scratch

size_t mim::plug::arm::Fpr_Scratch = encoding(fpr::d31)
constexpr

d31 breaks a copy cycle, so allocation leaves it alone.

Definition at line 46 of file arm.h.

Referenced by mim::plug::arm::Target::reserved().

◆ Num_Fpr

size_t mim::plug::arm::Num_Fpr = Annex::num<fpr>()
constexpr

Definition at line 16 of file arm.h.

Referenced by mim::plug::arm::Target::num_regs().

◆ Num_Regs

size_t mim::plug::arm::Num_Regs = Annex::num<reg>()
constexpr

Definition at line 15 of file arm.h.

Referenced by mim::plug::arm::Target::num_regs().

◆ Plugin_Id

plugin_t mim::plug::arm::Plugin_Id = 0x933800000000000
staticconstexpr

Definition at line 10 of file autogen.h.

◆ Ret_Fpr

size_t mim::plug::arm::Ret_Fpr = encoding(fpr::d0)
constexpr

Definition at line 44 of file arm.h.

Referenced by mim::plug::arm::Target::ret_reg().

◆ Ret_Reg

size_t mim::plug::arm::Ret_Reg = encoding(reg::x0)
constexpr

Definition at line 25 of file arm.h.

Referenced by mim::plug::arm::Target::ret_reg().