qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 3/4] target-tricore: Added new MOV instruction variant
@ 2016-05-31  5:48 peer.adelt
  2016-05-31  8:49 ` Bastian Koppelmann
  0 siblings, 1 reply; 2+ messages in thread
From: peer.adelt @ 2016-05-31  5:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, Peer Adelt

From: Peer Adelt <peer.adelt@c-lab.de>

Puts the content of data register D[a] into E[c][63:32] and the
content of data register D[b] into E[c][31:0].

Signed-off-by: Peer Adelt <peer.adelt@c-lab.de>
---
 target-tricore/translate.c       | 8 ++++++++
 target-tricore/tricore-opcodes.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/target-tricore/translate.c b/target-tricore/translate.c
index e66b433..960ee33 100644
--- a/target-tricore/translate.c
+++ b/target-tricore/translate.c
@@ -6224,6 +6224,14 @@ static void decode_rr_accumulator(CPUTriCoreState *env, DisasContext *ctx)
     case OPC2_32_RR_MOV:
         tcg_gen_mov_tl(cpu_gpr_d[r3], cpu_gpr_d[r2]);
         break;
+    case OPC2_32_RR_MOV_EXT:
+        if (tricore_feature(env, TRICORE_FEATURE_16)) {
+            tcg_gen_mov_tl(cpu_gpr_d[r3], cpu_gpr_d[r1]);
+            tcg_gen_mov_tl(cpu_gpr_d[(r3+1)], cpu_gpr_d[r2]);
+        } else {
+            generate_trap(ctx, TRAPC_INSN_ERR, TIN2_IOPC);
+        }
+        break;
     case OPC2_32_RR_NE:
         tcg_gen_setcond_tl(TCG_COND_NE, cpu_gpr_d[r3], cpu_gpr_d[r1],
                            cpu_gpr_d[r2]);
diff --git a/target-tricore/tricore-opcodes.h b/target-tricore/tricore-opcodes.h
index df666b0..2f25613 100644
--- a/target-tricore/tricore-opcodes.h
+++ b/target-tricore/tricore-opcodes.h
@@ -1062,6 +1062,7 @@ enum {
     OPC2_32_RR_MIN_H                             = 0x78,
     OPC2_32_RR_MIN_HU                            = 0x79,
     OPC2_32_RR_MOV                               = 0x1f,
+    OPC2_32_RR_MOV_EXT                           = 0x81,
     OPC2_32_RR_NE                                = 0x11,
     OPC2_32_RR_OR_EQ                             = 0x27,
     OPC2_32_RR_OR_GE                             = 0x2b,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH v2 3/4] target-tricore: Added new MOV instruction variant
  2016-05-31  5:48 [Qemu-devel] [PATCH v2 3/4] target-tricore: Added new MOV instruction variant peer.adelt
@ 2016-05-31  8:49 ` Bastian Koppelmann
  0 siblings, 0 replies; 2+ messages in thread
From: Bastian Koppelmann @ 2016-05-31  8:49 UTC (permalink / raw)
  To: peer.adelt, qemu-devel

On 05/31/2016 07:48 AM, peer.adelt@c-lab.de wrote:
> From: Peer Adelt <peer.adelt@c-lab.de>
> 
> Puts the content of data register D[a] into E[c][63:32] and the
> content of data register D[b] into E[c][31:0].
> 
> Signed-off-by: Peer Adelt <peer.adelt@c-lab.de>
> ---
>  target-tricore/translate.c       | 8 ++++++++
>  target-tricore/tricore-opcodes.h | 1 +
>  2 files changed, 9 insertions(+)
> 
> diff --git a/target-tricore/translate.c b/target-tricore/translate.c
> index e66b433..960ee33 100644
> --- a/target-tricore/translate.c
> +++ b/target-tricore/translate.c
> @@ -6224,6 +6224,14 @@ static void decode_rr_accumulator(CPUTriCoreState *env, DisasContext *ctx)
>      case OPC2_32_RR_MOV:
>          tcg_gen_mov_tl(cpu_gpr_d[r3], cpu_gpr_d[r2]);
>          break;
> +    case OPC2_32_RR_MOV_EXT:
> +        if (tricore_feature(env, TRICORE_FEATURE_16)) {
> +            tcg_gen_mov_tl(cpu_gpr_d[r3], cpu_gpr_d[r1]);
> +            tcg_gen_mov_tl(cpu_gpr_d[(r3+1)], cpu_gpr_d[r2]);

If r2 == r3 you would move r1 into r3+1 which is wrong. Use temporaries
instead of directly writing to r3.

Cheers,
    Bastian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-31  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-31  5:48 [Qemu-devel] [PATCH v2 3/4] target-tricore: Added new MOV instruction variant peer.adelt
2016-05-31  8:49 ` Bastian Koppelmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).