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

The core Plugin More...

Enumerations

<tt>core.M</tt>
enum class  M : flags_t
<tt>core.Ptr</tt>
enum class  Ptr : flags_t
<tt>core.mode</tt>
enum class  mode : flags_t {
  us = 0x1104c60000000400 ,
  uS = 0x1104c60000000401 ,
  nsw = 0x1104c60000000401 ,
  Us = 0x1104c60000000402 ,
  nuw = 0x1104c60000000402 ,
  US = 0x1104c60000000403 ,
  nsuw = 0x1104c60000000403
}
<tt>core.minus</tt>
enum class  minus : flags_t
<tt>core.select</tt>
enum class  select : flags_t
enum class  Select : flags_t

Functions

void register_normalizers (Normalizers &normalizers)
core.trait
const Def * op (trait o, const Def *type)
core.pe
const Def * op (pe o, const Def *def)
core.bit2
constexpr std::array< std::array< u64, 2 >, 2 > make_truth_table (bit2 id)

Variables

constexpr flags_t icmp_mask = 0b00011111
static constexpr plugin_t Plugin_Id = 0x1104c60000000000

Mode

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

<tt>core.nat</tt>

enum class  nat : flags_t {
  add = 0x1104c60000000200 ,
  sub = 0x1104c60000000201 ,
  mul = 0x1104c60000000202 ,
  div = 0x1104c60000000203 ,
  rem = 0x1104c60000000204
}
template<nat id>
const Def * normalize_nat (const Def *type, const Def *callee, const Def *arg)

<tt>core.ncmp</tt>

enum class  ncmp : flags_t {
  gle = 0x1104c60000000300 ,
  f = 0x1104c60000000300 ,
  glE = 0x1104c60000000301 ,
  e = 0x1104c60000000301 ,
  gLe = 0x1104c60000000302 ,
  l = 0x1104c60000000302 ,
  gLE = 0x1104c60000000303 ,
  le = 0x1104c60000000303 ,
  Gle = 0x1104c60000000304 ,
  g = 0x1104c60000000304 ,
  GlE = 0x1104c60000000305 ,
  ge = 0x1104c60000000305 ,
  GLe = 0x1104c60000000306 ,
  ne = 0x1104c60000000306 ,
  GLE = 0x1104c60000000307 ,
  t = 0x1104c60000000307
}
template<ncmp id>
const Def * normalize_ncmp (const Def *type, const Def *callee, const Def *arg)

<tt>core.idx</tt>

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

<tt>core.bit1</tt>

enum class  bit1 : flags_t {
  f = 0x1104c60000000600 ,
  neg = 0x1104c60000000601 ,
  id = 0x1104c60000000602 ,
  t = 0x1104c60000000603
}
template<bit1 id>
const Def * normalize_bit1 (const Def *type, const Def *c, const Def *a)

<tt>core.bit2</tt>

enum class  bit2 : flags_t {
  f = 0x1104c60000000700 ,
  nor = 0x1104c60000000701 ,
  nciff = 0x1104c60000000702 ,
  nfst = 0x1104c60000000703 ,
  niff = 0x1104c60000000704 ,
  nsnd = 0x1104c60000000705 ,
  xor_ = 0x1104c60000000706 ,
  nand = 0x1104c60000000707 ,
  and_ = 0x1104c60000000708 ,
  nxor = 0x1104c60000000709 ,
  snd = 0x1104c6000000070a ,
  iff = 0x1104c6000000070b ,
  fst = 0x1104c6000000070c ,
  ciff = 0x1104c6000000070d ,
  or_ = 0x1104c6000000070e ,
  t = 0x1104c6000000070f
}
template<bit2 id>
const Def * normalize_bit2 (const Def *type, const Def *c, const Def *arg)

<tt>core.shr</tt>

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

<tt>core.wrap</tt>

enum class  wrap : flags_t {
  add = 0x1104c60000000900 ,
  sub = 0x1104c60000000901 ,
  mul = 0x1104c60000000902 ,
  shl = 0x1104c60000000903
}
template<wrap id>
const Def * normalize_wrap (const Def *type, const Def *c, const Def *arg)

<tt>core.div</tt>

enum class  div : flags_t {
  sdiv = 0x1104c60000000b00 ,
  udiv = 0x1104c60000000b01 ,
  srem = 0x1104c60000000b02 ,
  urem = 0x1104c60000000b03
}
template<div id>
const Def * normalize_div (const Def *full_type, const Def *, const Def *arg)

<tt>core.icmp</tt>

enum class  icmp : flags_t {
  xygle = 0x1104c60000000c00 ,
  f = 0x1104c60000000c00 ,
  xyglE = 0x1104c60000000c01 ,
  e = 0x1104c60000000c01 ,
  xygLe = 0x1104c60000000c02 ,
  xygLE = 0x1104c60000000c03 ,
  xyGle = 0x1104c60000000c04 ,
  xyGlE = 0x1104c60000000c05 ,
  xyGLe = 0x1104c60000000c06 ,
  xyGLE = 0x1104c60000000c07 ,
  xYgle = 0x1104c60000000c08 ,
  xYglE = 0x1104c60000000c09 ,
  xYgLe = 0x1104c60000000c0a ,
  sl = 0x1104c60000000c0a ,
  xYgLE = 0x1104c60000000c0b ,
  sle = 0x1104c60000000c0b ,
  xYGle = 0x1104c60000000c0c ,
  ug = 0x1104c60000000c0c ,
  xYGlE = 0x1104c60000000c0d ,
  uge = 0x1104c60000000c0d ,
  xYGLe = 0x1104c60000000c0e ,
  xYGLE = 0x1104c60000000c0f ,
  Xygle = 0x1104c60000000c10 ,
  XyglE = 0x1104c60000000c11 ,
  XygLe = 0x1104c60000000c12 ,
  ul = 0x1104c60000000c12 ,
  XygLE = 0x1104c60000000c13 ,
  ule = 0x1104c60000000c13 ,
  XyGle = 0x1104c60000000c14 ,
  sg = 0x1104c60000000c14 ,
  XyGlE = 0x1104c60000000c15 ,
  sge = 0x1104c60000000c15 ,
  XyGLe = 0x1104c60000000c16 ,
  XyGLE = 0x1104c60000000c17 ,
  XYgle = 0x1104c60000000c18 ,
  XYglE = 0x1104c60000000c19 ,
  XYgLe = 0x1104c60000000c1a ,
  XYgLE = 0x1104c60000000c1b ,
  XYGle = 0x1104c60000000c1c ,
  XYGlE = 0x1104c60000000c1d ,
  XYGLe = 0x1104c60000000c1e ,
  ne = 0x1104c60000000c1e ,
  XYGLE = 0x1104c60000000c1f ,
  t = 0x1104c60000000c1f
}
template<icmp id>
const Def * normalize_icmp (const Def *type, const Def *c, const Def *arg)

<tt>core.extrema</tt>

enum class  extrema : flags_t {
  sm = 0x1104c60000000d00 ,
  umin = 0x1104c60000000d00 ,
  sM = 0x1104c60000000d01 ,
  umax = 0x1104c60000000d01 ,
  Sm = 0x1104c60000000d02 ,
  smin = 0x1104c60000000d02 ,
  SM = 0x1104c60000000d03 ,
  smax = 0x1104c60000000d03
}
template<extrema id>
const Def * normalize_extrema (const Def *type, const Def *c, const Def *arg)

<tt>core.abs</tt>

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

<tt>core.conv</tt>

enum class  conv : flags_t {
  s = 0x1104c60000000f00 ,
  u = 0x1104c60000000f01
}
template<conv id>
const Def * normalize_conv (const Def *dst_t, const Def *, const Def *x)

<tt>core.idx2nat</tt>

enum class  idx2nat : flags_t
const Def * normalize_idx2nat (const Def *type, const Def *, const Def *x)

<tt>core.bitcast</tt>

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

<tt>core.trait</tt>

enum class  trait : flags_t {
  size = 0x1104c60000001200 ,
  align = 0x1104c60000001201
}
template<trait id>
const Def * normalize_trait (const Def *, const Def *, const Def *type)

<tt>core.pe</tt>

enum class  pe : flags_t {
  hlt = 0x1104c60000001300 ,
  run = 0x1104c60000001301 ,
  is_closed = 0x1104c60000001302
}
template<pe id>
const Def * normalize_pe (const Def *type, const Def *, 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::core::Mode, mim::nat_t or const Def*.

Definition at line 23 of file core.h.

Enumeration Type Documentation

◆ abs

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

Definition at line 250 of file autogen.h.

◆ bit1

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

Definition at line 91 of file autogen.h.

◆ bit2

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

Definition at line 105 of file autogen.h.

◆ bitcast

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

Definition at line 278 of file autogen.h.

◆ conv

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

Definition at line 258 of file autogen.h.

◆ div

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

Definition at line 164 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 232 of file autogen.h.

◆ icmp

enum class mim::plug::core::icmp : flags_t
strong
Enumerator
xygle 
f 
xyglE 
e 
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 
t 

Definition at line 178 of file autogen.h.

◆ idx

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

Definition at line 83 of file autogen.h.

◆ idx2nat

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

Definition at line 270 of file autogen.h.

◆ M

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

Definition at line 14 of file autogen.h.

◆ minus

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

Definition at line 157 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.

nsuw 

Definition at line 15 of file core.h.

◆ mode

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

Definition at line 69 of file autogen.h.

◆ nat

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

Definition at line 28 of file autogen.h.

◆ ncmp

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

Definition at line 43 of file autogen.h.

◆ pe

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

Definition at line 298 of file autogen.h.

◆ Ptr

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

Definition at line 21 of file autogen.h.

◆ Select

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

Definition at line 318 of file autogen.h.

◆ select

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

Definition at line 311 of file autogen.h.

◆ shr

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

Definition at line 131 of file autogen.h.

◆ trait

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

Definition at line 286 of file autogen.h.

◆ wrap

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

Definition at line 143 of file autogen.h.

Function Documentation

◆ 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 52 of file core.h.

References make_truth_table().

Referenced by make_truth_table(), and normalize_bit2().

◆ mode()

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

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

Definition at line 26 of file core.h.

◆ normalize_abs()

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

Definition at line 616 of file normalizers.cpp.

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

Referenced by normalize_abs().

◆ normalize_bit1()

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

Definition at line 627 of file normalizers.cpp.

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

Referenced by normalize_bit1().

◆ 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 )

◆ normalize_extrema()

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

Definition at line 608 of file normalizers.cpp.

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

Referenced by normalize_extrema().

◆ normalize_icmp()

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

Definition at line 590 of file normalizers.cpp.

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

Referenced by normalize_icmp().

◆ normalize_idx()

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

Definition at line 731 of file normalizers.cpp.

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

Referenced by normalize_idx().

◆ normalize_idx2nat()

const Def * mim::plug::core::normalize_idx2nat ( const Def * type,
const Def * ,
const Def * x )

Definition at line 911 of file normalizers.cpp.

References mim::Lit::isa(), mim::Idx::isa_lit(), l, normalize_idx2nat(), and mim::Def::type().

Referenced by normalize_idx2nat().

◆ 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 )

Definition at line 555 of file normalizers.cpp.

References a, e, f, g, ge, mim::Def::greater(), mim::is_commutative(), mim::Lit::isa(), l, le, ne, normalize_ncmp(), mim::Def::projs(), and t.

Referenced by normalize_ncmp().

◆ normalize_pe()

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

Definition at line 998 of file normalizers.cpp.

References hlt, mim::Def::is_closed(), is_closed, mim::Axm::isa(), and normalize_pe().

Referenced by normalize_pe().

◆ normalize_shr()

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

Definition at line 746 of file normalizers.cpp.

References a, mim::Idx::isa(), mim::Lit::isa(), normalize_shr(), mim::Def::projs(), and s.

Referenced by normalize_shr().

◆ 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 768 of file normalizers.cpp.

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

Referenced by normalize_wrap().

◆ op() [1/2]

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

Definition at line 43 of file core.h.

References op(), 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 35 of file core.h.

References op().

Referenced by normalize_trait(), op(), and op().

◆ register_normalizers()

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

Variable Documentation

◆ icmp_mask

flags_t mim::plug::core::icmp_mask = 0b00011111
constexpr

Definition at line 10 of file core.h.

◆ Plugin_Id

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

Definition at line 10 of file autogen.h.