aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>2012-05-17 15:37:49 +1000
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2012-05-18 12:17:52 +0200
commitace2e4dad70d23631a7944bff7255009234961ce (patch)
treee53230f055e8e9f244b54c3da4a772b635bbd94a
parent76ee152a86d5f2533443ce4d2be6fe253cfb3c45 (diff)
target-microblaze: impelemented swapx instructions
Implemented the swapb and swaph byte/halfword reversal instructions added to microblaze v8.30 Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
-rw-r--r--target-microblaze/translate.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index 742b3957c0..a362938e41 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -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);