Shift left/right
This commit is contained in:
parent
d6acb8d059
commit
7cba9f3cb2
|
|
@ -173,6 +173,10 @@ static vhdl_expr *translate_binary(ivl_expr_t e)
|
||||||
return translate_relation(lhs, rhs, VHDL_BINOP_LT);
|
return translate_relation(lhs, rhs, VHDL_BINOP_LT);
|
||||||
case '>':
|
case '>':
|
||||||
return translate_relation(lhs, rhs, VHDL_BINOP_GT);
|
return translate_relation(lhs, rhs, VHDL_BINOP_GT);
|
||||||
|
case 'l':
|
||||||
|
return translate_numeric(lhs, rhs, VHDL_BINOP_SL);
|
||||||
|
case 'r':
|
||||||
|
return translate_numeric(lhs, rhs, VHDL_BINOP_SR);
|
||||||
default:
|
default:
|
||||||
error("No translation for binary opcode '%c'\n",
|
error("No translation for binary opcode '%c'\n",
|
||||||
ivl_expr_opcode(e));
|
ivl_expr_opcode(e));
|
||||||
|
|
|
||||||
|
|
@ -746,6 +746,12 @@ void vhdl_binop_expr::emit(std::ofstream &of, int level) const
|
||||||
case VHDL_BINOP_GT:
|
case VHDL_BINOP_GT:
|
||||||
of << " > ";
|
of << " > ";
|
||||||
break;
|
break;
|
||||||
|
case VHDL_BINOP_SL:
|
||||||
|
of << " sll ";
|
||||||
|
break;
|
||||||
|
case VHDL_BINOP_SR:
|
||||||
|
of << " srl ";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
(*it)->emit(of, level);
|
(*it)->emit(of, level);
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,8 @@ enum vhdl_binop_t {
|
||||||
VHDL_BINOP_MULT,
|
VHDL_BINOP_MULT,
|
||||||
VHDL_BINOP_LT,
|
VHDL_BINOP_LT,
|
||||||
VHDL_BINOP_GT,
|
VHDL_BINOP_GT,
|
||||||
|
VHDL_BINOP_SL,
|
||||||
|
VHDL_BINOP_SR,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue