Shift left/right

This commit is contained in:
Nick Gasson 2008-06-21 15:19:33 +01:00
parent d6acb8d059
commit 7cba9f3cb2
3 changed files with 12 additions and 0 deletions

View File

@ -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));

View File

@ -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);

View File

@ -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,
}; };
/* /*