qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, rth@twiddle.net
Subject: [Qemu-devel] [PULL 6/9] target-tricore: Make TRICORE_FEATURES implying others.
Date: Wed, 10 Dec 2014 11:36:29 +0000	[thread overview]
Message-ID: <1418211392-21440-7-git-send-email-kbastian@mail.uni-paderborn.de> (raw)
In-Reply-To: <1418211392-21440-1-git-send-email-kbastian@mail.uni-paderborn.de>

Since all the TriCore instructionsets are subsets of each other (1.3 C 1.3.1 C 1.6),
make the features implying each other, e.g 1.6 also has 1.3.1 and 1.3. This way
we only need to check our features for the instructionset, where a instruction was first introduced.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 target-tricore/cpu.c       | 9 +++++++++
 target-tricore/translate.c | 6 +++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/target-tricore/cpu.c b/target-tricore/cpu.c
index 7bf041a..abe16fa 100644
--- a/target-tricore/cpu.c
+++ b/target-tricore/cpu.c
@@ -63,8 +63,17 @@ static bool tricore_cpu_has_work(CPUState *cs)
 static void tricore_cpu_realizefn(DeviceState *dev, Error **errp)
 {
     CPUState *cs = CPU(dev);
+    TriCoreCPU *cpu = TRICORE_CPU(dev);
     TriCoreCPUClass *tcc = TRICORE_CPU_GET_CLASS(dev);
+    CPUTriCoreState *env = &cpu->env;
 
+    /* Some features automatically imply others */
+    if (tricore_feature(env, TRICORE_FEATURE_16)) {
+        set_feature(env, TRICORE_FEATURE_131);
+    }
+    if (tricore_feature(env, TRICORE_FEATURE_131)) {
+        set_feature(env, TRICORE_FEATURE_13);
+    }
     cpu_reset(cs);
     qemu_init_vcpu(cs);
 
diff --git a/target-tricore/translate.c b/target-tricore/translate.c
index 1daf26d..3775374 100644
--- a/target-tricore/translate.c
+++ b/target-tricore/translate.c
@@ -2206,17 +2206,17 @@ static void decode_bo_addrmode_post_pre_base(CPUTriCoreState *env,
     case OPC2_32_BO_CACHEI_WI_SHORTOFF:
     case OPC2_32_BO_CACHEI_W_SHORTOFF:
         /* TODO: Raise illegal opcode trap,
-                 if tricore_feature(TRICORE_FEATURE_13) */
+                 if !tricore_feature(TRICORE_FEATURE_131) */
         break;
     case OPC2_32_BO_CACHEI_W_POSTINC:
     case OPC2_32_BO_CACHEI_WI_POSTINC:
-        if (!tricore_feature(env, TRICORE_FEATURE_13)) {
+        if (tricore_feature(env, TRICORE_FEATURE_131)) {
             tcg_gen_addi_tl(cpu_gpr_d[r2], cpu_gpr_d[r2], off10);
         } /* TODO: else raise illegal opcode trap */
         break;
     case OPC2_32_BO_CACHEI_W_PREINC:
     case OPC2_32_BO_CACHEI_WI_PREINC:
-        if (!tricore_feature(env, TRICORE_FEATURE_13)) {
+        if (tricore_feature(env, TRICORE_FEATURE_131)) {
             tcg_gen_addi_tl(cpu_gpr_d[r2], cpu_gpr_d[r2], off10);
         } /* TODO: else raise illegal opcode trap */
         break;
-- 
2.1.3

  parent reply	other threads:[~2014-12-10 10:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10 11:36 [Qemu-devel] [PULL 0/9] tricore patches Bastian Koppelmann
2014-12-10 11:36 ` [Qemu-devel] [PULL 1/9] target-tricore: Add instructions of BOL opcode format Bastian Koppelmann
2014-12-10 11:36 ` [Qemu-devel] [PULL 2/9] target-tricore: Add instructions of BRC " Bastian Koppelmann
2014-12-10 11:36 ` [Qemu-devel] [PULL 3/9] target-tricore: Add instructions of BRN " Bastian Koppelmann
2014-12-10 11:36 ` [Qemu-devel] [PULL 4/9] target-tricore: Add instructions of BRR " Bastian Koppelmann
2014-12-10 11:36 ` [Qemu-devel] [PULL 5/9] target-tricore: Add instructions of RC " Bastian Koppelmann
2014-12-10 11:36 ` Bastian Koppelmann [this message]
2014-12-10 11:36 ` [Qemu-devel] [PULL 7/9] target-tricore: Add instructions of RCPW, RCRR and RCRW " Bastian Koppelmann
2014-12-10 11:36 ` [Qemu-devel] [PULL 8/9] target-tricore: Add instructions of RLC " Bastian Koppelmann
2014-12-10 11:36 ` [Qemu-devel] [PULL 9/9] target-tricore: Add instructions of RCR " Bastian Koppelmann
2014-12-11 12:07 ` [Qemu-devel] [PULL 0/9] tricore patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1418211392-21440-7-git-send-email-kbastian@mail.uni-paderborn.de \
    --to=kbastian@mail.uni-paderborn.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).