Permalink
Browse files

all inclusive working snapshot

  • Loading branch information...
1 parent 423a697 commit 5210f465bf338ea2fc3dc35e5ca0bbd37052d9b6 @mwolf76 committed Apr 7, 2013
View
@@ -15,9 +15,11 @@ INCLUDES = -I$(top_srcdir)/src/ -I$(top_srcdir)/src/expr \
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_CXXFLAGS = @AM_CXXFLAGS@
-PKG_HH = model.hh model_mgr.hh resolver.hh analyzer.hh inferrer.hh
+PKG_HH = model.hh model_mgr.hh resolver.hh analyzer.hh inferrer.hh \
+ symbol.hh
-PKG_CC = model.cc model_mgr.cc resolver.cc analyzer.cc inferrer.cc
+PKG_CC = model.cc model_mgr.cc resolver.cc analyzer.cc inferrer.cc \
+ symbol.cc
PKG_SOURCES = $(PKG_H) $(PKG_CC)
View
@@ -377,7 +377,6 @@ void Analyzer::walk_leaf(const Expr_ptr expr)
res = EXPR_BOOLEAN;
}
else if (f_tm.is_int_const(tp) ||
- f_tm.is_fxd_const(tp) ||
f_tm.is_algebraic(tp)) {
res = EXPR_ALGEBRAIC;
}
@@ -14,7 +14,7 @@ INCLUDES = -I$(top_srcdir)/src/ -I$(top_srcdir)/src/dd \
PKG_HH = compiler.hh
PKG_CC = compiler.cc algebra.cc boolean.cc integer.cc enumerative.cc \
-fixed.cc internals.cc
+internals.cc
PKG_SOURCES = $(PKG_H) $(PKG_CC)
@@ -52,15 +52,10 @@ void Compiler::algebraic_neg(const Expr_ptr expr)
unsigned width;
{
- /* fxd -> int type conversion */
- if (tm.is_signed_fixed_algebraic(type) ||
- tm.is_unsigned_fixed_algebraic(type)) {
- type = algebraic_make_int_of_fxd_type(type);
- }
if (tm.is_signed_algebraic(type)) {
width = tm.as_signed_algebraic(type)->width();
}
- else if (tm.is_unsigned_fixed_algebraic(type)) {
+ else if (tm.is_unsigned_algebraic(type)) {
width = tm.as_unsigned_algebraic(type)->width();
}
else {
@@ -88,15 +83,10 @@ void Compiler::algebraic_not(const Expr_ptr expr)
unsigned width;
{
- /* fxd -> int type conversion */
- if (tm.is_signed_fixed_algebraic(type) ||
- tm.is_unsigned_fixed_algebraic(type)) {
- type = algebraic_make_int_of_fxd_type(type);
- }
if (tm.is_signed_algebraic(type)) {
width = tm.as_signed_algebraic(type)->width();
}
- else if (tm.is_unsigned_fixed_algebraic(type)) {
+ else if (tm.is_unsigned_algebraic(type)) {
width = tm.as_unsigned_algebraic(type)->width();
}
else {
@@ -133,9 +133,6 @@ void Compiler::walk_neg_postorder(const Expr_ptr expr)
if (is_unary_integer(expr)) {
integer_neg(expr);
}
- else if (is_unary_fixed(expr)) {
- fixed_neg(expr);
- }
else if (is_unary_algebraic(expr)) {
algebraic_neg(expr);
}
@@ -167,9 +164,6 @@ void Compiler::walk_add_postorder(const Expr_ptr expr)
if (is_binary_integer(expr)) {
integer_plus(expr);
}
- else if (is_binary_fixed(expr)) {
- fixed_plus(expr);
- }
else if (is_binary_algebraic(expr)) {
algebraic_plus(expr);
}
@@ -185,9 +179,6 @@ void Compiler::walk_sub_postorder(const Expr_ptr expr)
if (is_binary_integer(expr)) {
integer_sub(expr);
}
- else if (is_binary_fixed(expr)) {
- fixed_sub(expr);
- }
else if (is_binary_algebraic(expr)) {
algebraic_sub(expr);
}
@@ -203,9 +194,6 @@ void Compiler::walk_div_postorder(const Expr_ptr expr)
if (is_binary_integer(expr)) {
integer_div(expr);
}
- else if (is_binary_fixed(expr)) {
- fixed_div(expr);
- }
else if (is_binary_algebraic(expr)) {
algebraic_div(expr);
}
@@ -221,9 +209,6 @@ void Compiler::walk_mul_postorder(const Expr_ptr expr)
if (is_binary_integer(expr)) {
integer_mul(expr);
}
- else if (is_binary_fixed(expr)) {
- fixed_mul(expr);
- }
else if (is_binary_algebraic(expr)) {
algebraic_mul(expr);
}
@@ -384,9 +369,6 @@ void Compiler::walk_eq_postorder(const Expr_ptr expr)
else if (is_binary_integer(expr)) {
integer_equals(expr);
}
- else if (is_binary_fixed(expr)) {
- fixed_equals(expr);
- }
else if (is_binary_algebraic(expr)) {
algebraic_equals(expr);
}
@@ -405,9 +387,6 @@ void Compiler::walk_ne_postorder(const Expr_ptr expr)
else if (is_binary_integer(expr)) {
integer_not_equals(expr);
}
- else if (is_binary_fixed(expr)) {
- fixed_not_equals(expr);
- }
else if (is_binary_algebraic(expr)) {
algebraic_not_equals(expr);
}
@@ -423,9 +402,6 @@ void Compiler::walk_gt_postorder(const Expr_ptr expr)
if (is_binary_integer(expr)) {
integer_gt(expr);
}
- else if (is_binary_fixed(expr)) {
- fixed_gt(expr);
- }
else if (is_binary_algebraic(expr)) {
algebraic_gt(expr);
}
@@ -441,9 +417,6 @@ void Compiler::walk_ge_postorder(const Expr_ptr expr)
if (is_binary_integer(expr)) {
integer_ge(expr);
}
- else if (is_binary_fixed(expr)) {
- fixed_ge(expr);
- }
else if (is_binary_algebraic(expr)) {
algebraic_ge(expr);
}
@@ -459,9 +432,6 @@ void Compiler::walk_lt_postorder(const Expr_ptr expr)
if (is_binary_integer(expr)) {
integer_lt(expr);
}
- else if (is_binary_fixed(expr)) {
- fixed_lt(expr);
- }
else if (is_binary_algebraic(expr)) {
algebraic_lt(expr);
}
@@ -477,9 +447,6 @@ void Compiler::walk_le_postorder(const Expr_ptr expr)
if (is_binary_integer(expr)) {
integer_le(expr);
}
- else if (is_binary_fixed(expr)) {
- fixed_le(expr);
- }
else if (is_binary_algebraic(expr)) {
algebraic_le(expr);
}
@@ -498,9 +465,6 @@ void Compiler::walk_ite_postorder(const Expr_ptr expr)
else if (is_ite_integer(expr)) {
integer_ite(expr);
}
- else if (is_ite_fixed(expr)) {
- fixed_ite(expr);
- }
else if (is_ite_enumerative(expr)) {
enumerative_ite(expr);
}
@@ -586,8 +550,7 @@ void Compiler::walk_subscript_postorder(const Expr_ptr expr)
const Type_ptr scalar_type = tm.as_array(lhs_type)->of();
unsigned width;
- if (tm.is_int_const(rhs_type) ||
- tm.is_fxd_const(rhs_type)) {
+ if (tm.is_int_const(rhs_type)) {
width = 1;
}
else if (tm.is_signed_algebraic(rhs_type)) {
@@ -698,14 +661,6 @@ void Compiler::walk_leaf(const Expr_ptr expr)
return;
}
- // 1.2. or fixed consts (e.g. 42.42) TODO: currently the number of
- // decimal digits in fract consts is a global setting.
- if (em.is_fxd_numeric(expr)) {
- f_type_stack.push_back(tm.find_fxd_const());
- f_add_stack.push_back(f_enc.constant(expr->value()));
- return;
- }
-
// 2. Symbols
ISymbol_ptr symb = resolver.fetch_symbol(ctx, expr);
@@ -296,7 +296,6 @@ protected:
ADD optimize_and_chain(ADD* dds, unsigned len);
- void algebraic_from_fxd_const(unsigned width);
void algebraic_from_int_const(unsigned width);
void algebraic_padding(unsigned old_width, unsigned new_width, bool is_signed);
@@ -308,10 +307,6 @@ protected:
/** @brief Adjusts operand */
void algebrize_operand(Type_ptr type, unsigned final_width);
- /** @brief Converts a fxd type into the corresponding int type,
- the new type width is equals to int_digits + fract_digits */
- Type_ptr algebraic_make_int_of_fxd_type(Type_ptr type);
-
/** @brief Determines the width of an algebraic type */
unsigned algebraic_type_width(Type_ptr type);
Oops, something went wrong.

0 comments on commit 5210f46

Please sign in to comment.