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
Ref extract_unsafe (Ref d, Ref i)
 
Ref extract_unsafe (Ref d, u64 i)
 
insert_unsafe
Ref insert_unsafe (Ref d, Ref i, Ref val)
 
Ref insert_unsafe (Ref d, u64 i, Ref 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, Ref>
 Give Mode as mim::plug::math::Mode, mim::nat_t or Ref.
 
Ref mode (World &w, VMode m)
 mim::plug::core::VMode -> Ref.
 

%core.nat

enum class  nat : flags_t {
  add = 0x1104c60000000000 ,
  sub = 0x1104c60000000001 ,
  mul = 0x1104c60000000002
}
 
template<nat id>
Ref normalize_nat (Ref type, Ref callee, Ref 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>
Ref normalize_ncmp (Ref type, Ref callee, Ref arg)
 

%core.idx

enum class  idx : flags_t
 
Ref normalize_idx (Ref type, Ref c, Ref arg)
 

%core.bit1

enum class  bit1 : flags_t {
  f = 0x1104c60000000400 ,
  neg = 0x1104c60000000401 ,
  id = 0x1104c60000000402 ,
  t = 0x1104c60000000403
}
 
template<bit1 id>
Ref normalize_bit1 (Ref type, Ref c, Ref 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>
Ref normalize_bit2 (Ref type, Ref c, Ref arg)
 

%core.shr

enum class  shr : flags_t {
  a = 0x1104c60000000600 ,
  l = 0x1104c60000000601
}
 
template<shr id>
Ref normalize_shr (Ref type, Ref c, Ref arg)
 

%core.wrap

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

%core.div

enum class  div : flags_t {
  sdiv = 0x1104c60000000900 ,
  udiv = 0x1104c60000000901 ,
  srem = 0x1104c60000000902 ,
  urem = 0x1104c60000000903
}
 
template<div id>
Ref normalize_div (Ref full_type, Ref c, Ref 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>
Ref normalize_icmp (Ref type, Ref c, Ref 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>
Ref normalize_extrema (Ref type, Ref c, Ref arg)
 

%core.abs

enum class  abs : flags_t
 
Ref normalize_abs (Ref type, Ref c, Ref arg)
 

%core.conv

enum class  conv : flags_t {
  s = 0x1104c60000000d00 ,
  u = 0x1104c60000000d01
}
 
template<conv id>
Ref normalize_conv (Ref dst_t, Ref c, Ref x)
 

%core.bitcast

enum class  bitcast : flags_t
 
Ref normalize_bitcast (Ref dst_t, Ref callee, Ref src)
 

%core.trait

enum class  trait : flags_t {
  size = 0x1104c60000000f00 ,
  align = 0x1104c60000000f01
}
 
Ref op (trait o, Ref type)
 
template<trait id>
Ref normalize_trait (Ref nat, Ref callee, Ref type)
 

%core.pe

enum class  pe : flags_t {
  hlt = 0x1104c60000001000 ,
  run = 0x1104c60000001001 ,
  known = 0x1104c60000001002
}
 
Ref op (pe o, Ref def)
 
template<pe id>
Ref normalize_pe (Ref type, Ref callee, Ref arg)
 

%core.zip

enum class  zip : flags_t
 
Ref normalize_zip (Ref type, Ref c, Ref arg)
 

Detailed Description

Typedef Documentation

◆ VMode

using mim::plug::core::VMode = std::variant<Mode, nat_t, Ref>

Give Mode as mim::plug::math::Mode, mim::nat_t or Ref.

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 
known 

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]

Ref mim::plug::core::extract_unsafe ( Ref d,
Ref i )
inline

Definition at line 60 of file core.h.

References u.

Referenced by extract_unsafe().

◆ extract_unsafe() [2/2]

Ref mim::plug::core::extract_unsafe ( Ref d,
u64 i )
inline

Definition at line 64 of file core.h.

References extract_unsafe().

◆ insert_unsafe() [1/2]

Ref mim::plug::core::insert_unsafe ( Ref d,
Ref i,
Ref val )
inline

Definition at line 72 of file core.h.

References u.

Referenced by insert_unsafe().

◆ insert_unsafe() [2/2]

Ref mim::plug::core::insert_unsafe ( Ref d,
u64 i,
Ref 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()

Ref mim::plug::core::mode ( World & w,
VMode m )
inline

mim::plug::core::VMode -> Ref.

Definition at line 24 of file core.h.

References std::get().

◆ normalize_abs()

Ref mim::plug::core::normalize_abs ( Ref type,
Ref c,
Ref arg )

Definition at line 298 of file normalizers.cpp.

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

◆ normalize_bit1()

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

Definition at line 309 of file normalizers.cpp.

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

◆ normalize_bit2()

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

◆ normalize_bitcast()

Ref mim::plug::core::normalize_bitcast ( Ref dst_t,
Ref callee,
Ref src )

◆ normalize_conv()

template<conv id>
Ref mim::plug::core::normalize_conv ( Ref dst_t,
Ref c,
Ref x )

◆ normalize_div()

template<div id>
Ref mim::plug::core::normalize_div ( Ref full_type,
Ref c,
Ref arg )

Definition at line 514 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>
Ref mim::plug::core::normalize_extrema ( Ref type,
Ref c,
Ref arg )

Definition at line 290 of file normalizers.cpp.

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

◆ normalize_icmp()

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

Definition at line 274 of file normalizers.cpp.

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

◆ normalize_idx()

Ref mim::plug::core::normalize_idx ( Ref type,
Ref c,
Ref arg )

Definition at line 411 of file normalizers.cpp.

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

◆ normalize_nat()

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

◆ normalize_ncmp()

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

◆ normalize_pe()

template<pe id>
Ref mim::plug::core::normalize_pe ( Ref type,
Ref callee,
Ref arg )

◆ normalize_shr()

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

◆ normalize_trait()

◆ normalize_wrap()

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

Definition at line 454 of file normalizers.cpp.

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

◆ normalize_zip()

Ref mim::plug::core::normalize_zip ( Ref type,
Ref c,
Ref arg )

Definition at line 662 of file normalizers.cpp.

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

◆ op() [1/2]

Ref mim::plug::core::op ( pe o,
Ref def )
inline

Definition at line 41 of file core.h.

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

◆ op() [2/2]

Ref mim::plug::core::op ( trait o,
Ref 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.