diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-06-14 19:33:58 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-06-14 19:33:58 +0200 |
commit | d5765b5e14319c20a62a20f470e8ec5dc48d0010 (patch) | |
tree | 2e73fcb51b3b51cce2639ea7bc82555ecead6d8e /frontends/ast/simplify.cc | |
parent | ebe2d733302fea50b75d3dd43d1a115e43dcb523 (diff) | |
download | yosys-d5765b5e14319c20a62a20f470e8ec5dc48d0010.tar.gz yosys-d5765b5e14319c20a62a20f470e8ec5dc48d0010.tar.bz2 yosys-d5765b5e14319c20a62a20f470e8ec5dc48d0010.zip |
Fixed relational operators for const real expressions
Diffstat (limited to 'frontends/ast/simplify.cc')
-rw-r--r-- | frontends/ast/simplify.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 89dc8ef73..61bc03b9f 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -1539,14 +1539,14 @@ skip_dynamic_range_lvalue_expansion:; } else if (children[0]->isConst() && children[1]->isConst()) { switch (type) { - case AST_LT: newNode = mkconst_int(children[0]->asReal(sign_hint) < children[1]->asReal(sign_hint), false, 1); - case AST_LE: newNode = mkconst_int(children[0]->asReal(sign_hint) <= children[1]->asReal(sign_hint), false, 1); - case AST_EQ: newNode = mkconst_int(children[0]->asReal(sign_hint) == children[1]->asReal(sign_hint), false, 1); - case AST_NE: newNode = mkconst_int(children[0]->asReal(sign_hint) != children[1]->asReal(sign_hint), false, 1); - case AST_EQX: newNode = mkconst_int(children[0]->asReal(sign_hint) == children[1]->asReal(sign_hint), false, 1); - case AST_NEX: newNode = mkconst_int(children[0]->asReal(sign_hint) != children[1]->asReal(sign_hint), false, 1); - case AST_GE: newNode = mkconst_int(children[0]->asReal(sign_hint) >= children[1]->asReal(sign_hint), false, 1); - case AST_GT: newNode = mkconst_int(children[0]->asReal(sign_hint) > children[1]->asReal(sign_hint), false, 1); + case AST_LT: newNode = mkconst_int(children[0]->asReal(sign_hint) < children[1]->asReal(sign_hint), false, 1); break; + case AST_LE: newNode = mkconst_int(children[0]->asReal(sign_hint) <= children[1]->asReal(sign_hint), false, 1); break; + case AST_EQ: newNode = mkconst_int(children[0]->asReal(sign_hint) == children[1]->asReal(sign_hint), false, 1); break; + case AST_NE: newNode = mkconst_int(children[0]->asReal(sign_hint) != children[1]->asReal(sign_hint), false, 1); break; + case AST_EQX: newNode = mkconst_int(children[0]->asReal(sign_hint) == children[1]->asReal(sign_hint), false, 1); break; + case AST_NEX: newNode = mkconst_int(children[0]->asReal(sign_hint) != children[1]->asReal(sign_hint), false, 1); break; + case AST_GE: newNode = mkconst_int(children[0]->asReal(sign_hint) >= children[1]->asReal(sign_hint), false, 1); break; + case AST_GT: newNode = mkconst_int(children[0]->asReal(sign_hint) > children[1]->asReal(sign_hint), false, 1); break; default: log_abort(); } } |