MimIR 0.1
MimIR is my Intermediate Representation
|
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 Sigma * | convert (const TBound< up > *b) |
const Sigma * | convert (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) |
using mim::plug::core::VMode = std::variant<Mode, nat_t, Ref> |
Give Mode as mim::plug::math::Mode, mim::nat_t or Ref.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
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().
Definition at line 64 of file core.h.
References extract_unsafe().
Definition at line 76 of file core.h.
References insert_unsafe().
Use like this: a op b = tab[a][b]
Definition at line 50 of file core.h.
Referenced by normalize_bit2().
|
inline |
Definition at line 298 of file normalizers.cpp.
References a, mim::Def::projs(), and mim::Def::world().
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().
Definition at line 332 of file normalizers.cpp.
References a, and_, ciff, mim::commute(), f, fst, iff, mim::is_commutative(), mim::Lit::isa(), make_truth_table(), nand, nciff, neg, nfst, niff, nor, nsnd, nxor, or_, mim::Def::projs(), s, snd, t, mim::Def::world(), and xor_.
Definition at line 593 of file normalizers.cpp.
References mim::Lit::isa(), l, mim::match(), mim::Idx::size(), mim::Def::type(), and mim::Def::world().
Definition at line 553 of file normalizers.cpp.
References mim::App::arg(), mim::Lit::isa(), l, M, s, mim::Idx::size2bitwidth(), mim::Def::type(), u, and mim::Def::world().
Definition at line 514 of file normalizers.cpp.
References a, mim::Lit::isa(), mim::Def::projs(), sdiv, srem, udiv, urem, and mim::Def::world().
Definition at line 290 of file normalizers.cpp.
References a, mim::Def::projs(), and mim::Def::world().
Definition at line 274 of file normalizers.cpp.
References a, e, f, ne, mim::Def::projs(), t, and mim::Def::world().
Definition at line 411 of file normalizers.cpp.
References mim::Lit::isa(), s, mim::Idx::size(), and mim::Def::world().
Definition at line 214 of file normalizers.cpp.
References a, add, mim::commute(), mim::is_commutative(), mim::Lit::isa(), mul, mim::Def::projs(), sub, and mim::Def::world().
Definition at line 246 of file normalizers.cpp.
References a, mim::commute(), e, f, g, ge, mim::is_commutative(), mim::Lit::isa(), l, le, mim::World::lit_tt(), ne, mim::Def::projs(), t, and mim::Def::world().
Definition at line 703 of file normalizers.cpp.
References mim::Def::dep_const(), hlt, known, mim::match(), mim::World::raw_app(), and mim::Def::world().
Definition at line 424 of file normalizers.cpp.
References a, mim::Lit::isa(), l, mim::Def::projs(), s, mim::Idx::size(), mim::Def::type(), and mim::Def::world().
Definition at line 615 of file normalizers.cpp.
References a, align, convert(), mim::Lit::isa(), mim::plug::math::isa_f(), mim::Def::isa_imm(), mim::match(), mul, op(), mim::Def::ops(), mim::pad(), mim::World::raw_app(), s, mim::Idx::size(), size, mim::Idx::size2bitwidth(), t, and mim::Def::world().
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().
Definition at line 662 of file normalizers.cpp.
References mim::App::arg(), f, mim::Lit::isa(), mim::Def::projs(), s, and mim::Def::world().
Definition at line 41 of file core.h.
References mim::Def::type(), and mim::Def::world().
Definition at line 33 of file core.h.
References mim::Def::world().
Referenced by convert(), and normalize_trait().
void mim::plug::core::register_normalizers | ( | Normalizers & | normalizers | ) |
Referenced by mim_get_plugin().