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

The core Plugin More...

Enumerations

%core.mode
enum class  mode : flags_t {
  us = 0x1104c60000000200 ,
  uS = 0x1104c60000000201 ,
  Us = 0x1104c60000000202 ,
  US = 0x1104c60000000203 ,
  nuw = 0x1104c60000000204 ,
  nsw = 0x1104c60000000205 ,
  nusw = 0x1104c60000000206
}
 
%core.minus
enum class  minus : flags_t
 

Functions

void register_normalizers (Normalizers &normalizers)
 
extract_unsafe
const Defextract_unsafe (const Def *d, const Def *i)
 
const Defextract_unsafe (const Def *d, u64 i)
 
insert_unsafe
const Definsert_unsafe (const Def *d, const Def *i, const Def *val)
 
const Definsert_unsafe (const Def *d, u64 i, const Def *val)
 
Convert TBound to Sigma

This is WIP.

template<bool up>
const Sigmaconvert (const TBound< up > *b)
 
const Sigmaconvert (const Bound *b)
 

Variables

static constexpr plugin_t Plugin_Id = 0x1104c60000000000
 

Mode

enum class  Mode : nat_t {
  none = 0 ,
  nsw = 1 << 0 ,
  nuw = 1 << 1 ,
  nusw = nuw | nsw
}
 
using VMode = std::variant<Mode, nat_t, const Def*>
 Give Mode as mim::plug::math::Mode, mim::nat_t or const Def*.
 
const Defmode (World &w, VMode m)
 mim::plug::core::VMode -> const Def*.
 

%core.nat

enum class  nat : flags_t {
  add = 0x1104c60000000000 ,
  sub = 0x1104c60000000001 ,
  mul = 0x1104c60000000002
}
 
template<nat id>
const Defnormalize_nat (const Def *type, const Def *callee, const Def *arg)
 

%core.ncmp

enum class  ncmp : flags_t {
  gle = 0x1104c60000000100 ,
  f = gle ,
  glE = 0x1104c60000000101 ,
  e = glE ,
  gLe = 0x1104c60000000102 ,
  l = gLe ,
  gLE = 0x1104c60000000103 ,
  le = gLE ,
  Gle = 0x1104c60000000104 ,
  g = Gle ,
  GlE = 0x1104c60000000105 ,
  ge = GlE ,
  GLe = 0x1104c60000000106 ,
  ne = GLe ,
  GLE = 0x1104c60000000107 ,
  t = GLE
}
 
template<ncmp id>
const Defnormalize_ncmp (const Def *type, const Def *callee, const Def *arg)
 

%core.idx

enum class  idx : flags_t
 
const Defnormalize_idx (const Def *type, const Def *c, const Def *arg)
 

%core.bit1

enum class  bit1 : flags_t {
  f = 0x1104c60000000400 ,
  neg = 0x1104c60000000401 ,
  id = 0x1104c60000000402 ,
  t = 0x1104c60000000403
}
 
template<bit1 id>
const Defnormalize_bit1 (const Def *type, const Def *c, const Def *a)
 

%core.bit2

enum class  bit2 : flags_t {
  f = 0x1104c60000000500 ,
  nor = 0x1104c60000000501 ,
  nciff = 0x1104c60000000502 ,
  nfst = 0x1104c60000000503 ,
  niff = 0x1104c60000000504 ,
  nsnd = 0x1104c60000000505 ,
  xor_ = 0x1104c60000000506 ,
  nand = 0x1104c60000000507 ,
  and_ = 0x1104c60000000508 ,
  nxor = 0x1104c60000000509 ,
  snd = 0x1104c6000000050a ,
  iff = 0x1104c6000000050b ,
  fst = 0x1104c6000000050c ,
  ciff = 0x1104c6000000050d ,
  or_ = 0x1104c6000000050e ,
  t = 0x1104c6000000050f
}
 
constexpr std::array< std::array< u64, 2 >, 2 > make_truth_table (bit2 id)
 
template<bit2 id>
const Defnormalize_bit2 (const Def *type, const Def *c, const Def *arg)
 

%core.shr

enum class  shr : flags_t {
  a = 0x1104c60000000600 ,
  l = 0x1104c60000000601
}
 
template<shr id>
const Defnormalize_shr (const Def *type, const Def *c, const Def *arg)
 

%core.wrap

enum class  wrap : flags_t {
  add = 0x1104c60000000700 ,
  sub = 0x1104c60000000701 ,
  mul = 0x1104c60000000702 ,
  shl = 0x1104c60000000703
}
 
template<wrap id>
const Defnormalize_wrap (const Def *type, const Def *c, const Def *arg)
 

%core.div

enum class  div : flags_t {
  sdiv = 0x1104c60000000900 ,
  udiv = 0x1104c60000000901 ,
  srem = 0x1104c60000000902 ,
  urem = 0x1104c60000000903
}
 
template<div id>
const Defnormalize_div (const Def *full_type, const Def *, const Def *arg)
 

%core.icmp

enum class  icmp : flags_t {
  xygle = 0x1104c60000000a00 ,
  f = xygle ,
  xyglE = 0x1104c60000000a01 ,
  e = xyglE ,
  xygLe = 0x1104c60000000a02 ,
  xygLE = 0x1104c60000000a03 ,
  xyGle = 0x1104c60000000a04 ,
  xyGlE = 0x1104c60000000a05 ,
  xyGLe = 0x1104c60000000a06 ,
  xyGLE = 0x1104c60000000a07 ,
  xYgle = 0x1104c60000000a08 ,
  xYglE = 0x1104c60000000a09 ,
  xYgLe = 0x1104c60000000a0a ,
  sl = xYgLe ,
  xYgLE = 0x1104c60000000a0b ,
  sle = xYgLE ,
  xYGle = 0x1104c60000000a0c ,
  ug = xYGle ,
  xYGlE = 0x1104c60000000a0d ,
  uge = xYGlE ,
  xYGLe = 0x1104c60000000a0e ,
  xYGLE = 0x1104c60000000a0f ,
  Xygle = 0x1104c60000000a10 ,
  XyglE = 0x1104c60000000a11 ,
  XygLe = 0x1104c60000000a12 ,
  ul = XygLe ,
  XygLE = 0x1104c60000000a13 ,
  ule = XygLE ,
  XyGle = 0x1104c60000000a14 ,
  sg = XyGle ,
  XyGlE = 0x1104c60000000a15 ,
  sge = XyGlE ,
  XyGLe = 0x1104c60000000a16 ,
  XyGLE = 0x1104c60000000a17 ,
  XYgle = 0x1104c60000000a18 ,
  XYglE = 0x1104c60000000a19 ,
  XYgLe = 0x1104c60000000a1a ,
  XYgLE = 0x1104c60000000a1b ,
  XYGle = 0x1104c60000000a1c ,
  XYGlE = 0x1104c60000000a1d ,
  XYGLe = 0x1104c60000000a1e ,
  ne = XYGLe ,
  XYGLE = 0x1104c60000000a1f ,
  t = XYGLE
}
 
template<icmp id>
const Defnormalize_icmp (const Def *type, const Def *c, const Def *arg)
 

%core.extrema

enum class  extrema : flags_t {
  sm = 0x1104c60000000b00 ,
  umin = sm ,
  sM = 0x1104c60000000b01 ,
  umax = sM ,
  Sm = 0x1104c60000000b02 ,
  smin = Sm ,
  SM = 0x1104c60000000b03 ,
  smax = SM
}
 
template<extrema id>
const Defnormalize_extrema (const Def *type, const Def *c, const Def *arg)
 

%core.abs

enum class  abs : flags_t
 
const Defnormalize_abs (const Def *type, const Def *, const Def *arg)
 

%core.conv

enum class  conv : flags_t {
  s = 0x1104c60000000d00 ,
  u = 0x1104c60000000d01
}
 
template<conv id>
const Defnormalize_conv (const Def *dst_t, const Def *, const Def *x)
 

%core.bitcast

enum class  bitcast : flags_t
 
const Defnormalize_bitcast (const Def *dst_t, const Def *, const Def *src)
 

%core.trait

enum class  trait : flags_t {
  size = 0x1104c60000000f00 ,
  align = 0x1104c60000000f01
}
 
const Defop (trait o, const Def *type)
 
template<trait id>
const Defnormalize_trait (const Def *, const Def *, const Def *type)
 

%core.pe

enum class  pe : flags_t {
  hlt = 0x1104c60000001000 ,
  run = 0x1104c60000001001 ,
  is_closed = 0x1104c60000001002
}
 
const Defop (pe o, const Def *def)
 
template<pe id>
const Defnormalize_pe (const Def *type, const Def *, const Def *arg)
 

%core.zip

enum class  zip : flags_t
 
const Defnormalize_zip (const Def *type, const Def *c, const Def *arg)
 

Detailed Description

Typedef Documentation

◆ VMode

using mim::plug::core::VMode = std::variant<Mode, nat_t, const Def*>

Give Mode as mim::plug::math::Mode, mim::nat_t or const Def*.

Definition at line 21 of file core.h.

Enumeration Type Documentation

◆ abs

enum class mim::plug::core::abs : flags_t
strong

Definition at line 234 of file autogen.h.

◆ bit1

enum class mim::plug::core::bit1 : flags_t
strong
Enumerator
neg 
id 

Definition at line 75 of file autogen.h.

◆ bit2

enum class mim::plug::core::bit2 : flags_t
strong
Enumerator
nor 
nciff 
nfst 
niff 
nsnd 
xor_ 
nand 
and_ 
nxor 
snd 
iff 
fst 
ciff 
or_ 

Definition at line 89 of file autogen.h.

◆ bitcast

enum class mim::plug::core::bitcast : flags_t
strong

Definition at line 254 of file autogen.h.

◆ conv

enum class mim::plug::core::conv : flags_t
strong
Enumerator

Definition at line 242 of file autogen.h.

◆ div

enum class mim::plug::core::div : flags_t
strong
Enumerator
sdiv 
udiv 
srem 
urem 

Definition at line 148 of file autogen.h.

◆ extrema

enum class mim::plug::core::extrema : flags_t
strong
Enumerator
sm 
umin 
sM 
umax 
Sm 
smin 
SM 
smax 

Definition at line 216 of file autogen.h.

◆ icmp

enum class mim::plug::core::icmp : flags_t
strong
Enumerator
xygle 
xyglE 
xygLe 
xygLE 
xyGle 
xyGlE 
xyGLe 
xyGLE 
xYgle 
xYglE 
xYgLe 
sl 
xYgLE 
sle 
xYGle 
ug 
xYGlE 
uge 
xYGLe 
xYGLE 
Xygle 
XyglE 
XygLe 
ul 
XygLE 
ule 
XyGle 
sg 
XyGlE 
sge 
XyGLe 
XyGLE 
XYgle 
XYglE 
XYgLe 
XYgLE 
XYGle 
XYGlE 
XYGLe 
ne 
XYGLE 

Definition at line 162 of file autogen.h.

◆ idx

enum class mim::plug::core::idx : flags_t
strong

Definition at line 67 of file autogen.h.

◆ minus

enum class mim::plug::core::minus : flags_t
strong

Definition at line 141 of file autogen.h.

◆ Mode

enum class mim::plug::core::Mode : nat_t
strong

What should happen if Idx arithmetic overflows?

Enumerator
none 

Wrap around.

nsw 

No Signed Wrap around.

nuw 

No Unsigned Wrap around.

nusw 

Definition at line 13 of file core.h.

◆ mode

enum class mim::plug::core::mode : flags_t
strong
Enumerator
us 
uS 
Us 
US 
nuw 
nsw 
nusw 

Definition at line 53 of file autogen.h.

◆ nat

enum class mim::plug::core::nat : flags_t
strong
Enumerator
add 
sub 
mul 

Definition at line 14 of file autogen.h.

◆ ncmp

enum class mim::plug::core::ncmp : flags_t
strong
Enumerator
gle 
glE 
gLe 
gLE 
le 
Gle 
GlE 
ge 
GLe 
ne 
GLE 

Definition at line 27 of file autogen.h.

◆ pe

enum class mim::plug::core::pe : flags_t
strong
Enumerator
hlt 
run 
is_closed 

Definition at line 274 of file autogen.h.

◆ shr

enum class mim::plug::core::shr : flags_t
strong
Enumerator

Definition at line 115 of file autogen.h.

◆ trait

enum class mim::plug::core::trait : flags_t
strong
Enumerator
size 
align 

Definition at line 262 of file autogen.h.

◆ wrap

enum class mim::plug::core::wrap : flags_t
strong
Enumerator
add 
sub 
mul 
shl 

Definition at line 127 of file autogen.h.

◆ zip

enum class mim::plug::core::zip : flags_t
strong

Definition at line 287 of file autogen.h.

Function Documentation

◆ convert() [1/2]

const Sigma * mim::plug::core::convert ( const Bound * b)
inline

Definition at line 86 of file core.h.

References convert().

◆ convert() [2/2]

template<bool up>
const Sigma * mim::plug::core::convert ( const TBound< up > * b)

Definition at line 19 of file core.cpp.

References a, align, mim::Lit::isa(), mim::Def::num_ops(), op(), mim::Def::ops(), s, size, and mim::Def::world().

Referenced by convert(), and normalize_trait().

◆ extract_unsafe() [1/2]

const Def * mim::plug::core::extract_unsafe ( const Def * d,
const Def * i )
inline

Definition at line 60 of file core.h.

References u.

Referenced by extract_unsafe().

◆ extract_unsafe() [2/2]

const Def * mim::plug::core::extract_unsafe ( const Def * d,
u64 i )
inline

Definition at line 64 of file core.h.

References extract_unsafe().

◆ insert_unsafe() [1/2]

const Def * mim::plug::core::insert_unsafe ( const Def * d,
const Def * i,
const Def * val )
inline

Definition at line 72 of file core.h.

References u.

Referenced by insert_unsafe().

◆ insert_unsafe() [2/2]

const Def * mim::plug::core::insert_unsafe ( const Def * d,
u64 i,
const Def * val )
inline

Definition at line 76 of file core.h.

References insert_unsafe().

◆ make_truth_table()

std::array< std::array< u64, 2 >, 2 > mim::plug::core::make_truth_table ( bit2 id)
constexpr

Use like this: a op b = tab[a][b]

Definition at line 50 of file core.h.

Referenced by normalize_bit2().

◆ mode()

const Def * mim::plug::core::mode ( World & w,
VMode m )
inline

mim::plug::core::VMode -> const Def*.

Definition at line 24 of file core.h.

◆ normalize_abs()

const Def * mim::plug::core::normalize_abs ( const Def * type,
const Def * ,
const Def * arg )

Definition at line 300 of file normalizers.cpp.

References a, mim::Def::projs(), and mim::Def::world().

◆ normalize_bit1()

template<bit1 id>
const Def * mim::plug::core::normalize_bit1 ( const Def * type,
const Def * c,
const Def * a )

Definition at line 310 of file normalizers.cpp.

References a, f, id, mim::Lit::isa(), neg, s, t, and mim::Def::world().

◆ normalize_bit2()

template<bit2 id>
const Def * mim::plug::core::normalize_bit2 ( const Def * type,
const Def * c,
const Def * arg )

◆ normalize_bitcast()

const Def * mim::plug::core::normalize_bitcast ( const Def * dst_t,
const Def * ,
const Def * src )

◆ normalize_conv()

template<conv id>
const Def * mim::plug::core::normalize_conv ( const Def * dst_t,
const Def * ,
const Def * x )

◆ normalize_div()

template<div id>
const Def * mim::plug::core::normalize_div ( const Def * full_type,
const Def * ,
const Def * arg )

Definition at line 515 of file normalizers.cpp.

References a, mim::Lit::isa(), mim::Def::projs(), sdiv, srem, udiv, urem, and mim::Def::world().

◆ normalize_extrema()

template<extrema id>
const Def * mim::plug::core::normalize_extrema ( const Def * type,
const Def * c,
const Def * arg )

Definition at line 292 of file normalizers.cpp.

References a, mim::Def::projs(), and mim::Def::world().

◆ normalize_icmp()

template<icmp id>
const Def * mim::plug::core::normalize_icmp ( const Def * type,
const Def * c,
const Def * arg )

Definition at line 276 of file normalizers.cpp.

References a, e, f, ne, mim::Def::projs(), t, and mim::Def::world().

◆ normalize_idx()

const Def * mim::plug::core::normalize_idx ( const Def * type,
const Def * c,
const Def * arg )

Definition at line 412 of file normalizers.cpp.

References mim::Idx::isa(), mim::Lit::isa(), s, and mim::Def::world().

◆ normalize_nat()

template<nat id>
const Def * mim::plug::core::normalize_nat ( const Def * type,
const Def * callee,
const Def * arg )

◆ normalize_ncmp()

template<ncmp id>
const Def * mim::plug::core::normalize_ncmp ( const Def * type,
const Def * callee,
const Def * arg )

◆ normalize_pe()

template<pe id>
const Def * mim::plug::core::normalize_pe ( const Def * type,
const Def * ,
const Def * arg )

Definition at line 701 of file normalizers.cpp.

References hlt, mim::Def::is_closed(), is_closed, mim::match(), and mim::Def::world().

◆ normalize_shr()

template<shr id>
const Def * mim::plug::core::normalize_shr ( const Def * type,
const Def * c,
const Def * arg )

◆ normalize_trait()

template<trait id>
const Def * mim::plug::core::normalize_trait ( const Def * ,
const Def * ,
const Def * type )

◆ normalize_wrap()

template<wrap id>
const Def * mim::plug::core::normalize_wrap ( const Def * type,
const Def * c,
const Def * arg )

Definition at line 455 of file normalizers.cpp.

References a, add, mim::Idx::isa(), mim::Lit::isa(), mul, mim::Def::projs(), s, shl, sub, and mim::Def::world().

◆ normalize_zip()

const Def * mim::plug::core::normalize_zip ( const Def * type,
const Def * c,
const Def * arg )

Definition at line 660 of file normalizers.cpp.

References mim::App::arg(), f, mim::Lit::isa(), mim::Def::projs(), s, and mim::Def::world().

◆ op() [1/2]

const Def * mim::plug::core::op ( pe o,
const Def * def )
inline

Definition at line 41 of file core.h.

References mim::Def::type(), and mim::Def::world().

◆ op() [2/2]

const Def * mim::plug::core::op ( trait o,
const Def * type )
inline

Definition at line 33 of file core.h.

References mim::Def::world().

Referenced by convert(), and normalize_trait().

◆ register_normalizers()

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

Referenced by mim_get_plugin().

Variable Documentation

◆ Plugin_Id

plugin_t mim::plug::core::Plugin_Id = 0x1104c60000000000
staticconstexpr

Definition at line 10 of file autogen.h.