Unary minus
This commit is contained in:
parent
3ca85491ee
commit
a5db0297b0
|
|
@ -149,6 +149,9 @@ static vhdl_expr *translate_unary(ivl_expr_t e)
|
|||
case '~':
|
||||
return new vhdl_unaryop_expr
|
||||
(VHDL_UNARYOP_NOT, operand, new vhdl_type(*operand->get_type()));
|
||||
case '-':
|
||||
return new vhdl_unaryop_expr
|
||||
(VHDL_UNARYOP_NEG, operand, new vhdl_type(*operand->get_type()));
|
||||
case 'N': // NOR
|
||||
return translate_reduction(SF_REDUCE_OR, true, operand);
|
||||
case '|':
|
||||
|
|
|
|||
|
|
@ -657,6 +657,9 @@ void vhdl_unaryop_expr::emit(std::ostream &of, int level) const
|
|||
case VHDL_UNARYOP_NOT:
|
||||
of << "not ";
|
||||
break;
|
||||
case VHDL_UNARYOP_NEG:
|
||||
of << "-";
|
||||
break;
|
||||
}
|
||||
operand_->emit(of, level);
|
||||
of << ")";
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ private:
|
|||
|
||||
enum vhdl_unaryop_t {
|
||||
VHDL_UNARYOP_NOT,
|
||||
VHDL_UNARYOP_NEG,
|
||||
};
|
||||
|
||||
class vhdl_unaryop_expr : public vhdl_expr {
|
||||
|
|
|
|||
Loading…
Reference in New Issue