提交 ace2e4da 编写于 作者: P Peter A. G. Crosthwaite 提交者: Edgar E. Iglesias

target-microblaze: impelemented swapx instructions

Implemented the swapb and swaph byte/halfword reversal instructions added
to microblaze v8.30
Signed-off-by: NPeter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: NEdgar E. Iglesias <edgar.iglesias@gmail.com>
上级 76ee152a
......@@ -743,7 +743,7 @@ static void dec_bit(DisasContext *dc)
unsigned int op;
int mem_index = cpu_mmu_index(dc->env);
op = dc->ir & ((1 << 8) - 1);
op = dc->ir & ((1 << 9) - 1);
switch (op) {
case 0x21:
/* src. */
......@@ -825,6 +825,16 @@ static void dec_bit(DisasContext *dc)
gen_helper_clz(cpu_R[dc->rd], cpu_R[dc->ra]);
}
break;
case 0x1e0:
/* swapb */
LOG_DIS("swapb r%d r%d\n", dc->rd, dc->ra);
tcg_gen_bswap32_i32(cpu_R[dc->rd], cpu_R[dc->ra]);
break;
case 0x1e1:
/*swaph */
LOG_DIS("swaph r%d r%d\n", dc->rd, dc->ra);
tcg_gen_rotri_i32(cpu_R[dc->rd], cpu_R[dc->ra], 16);
break;
default:
cpu_abort(dc->env, "unknown bit oc=%x op=%x rd=%d ra=%d rb=%d\n",
dc->pc, op, dc->rd, dc->ra, dc->rb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册