Skip to contentSkip to conversation

target/mips queue

GIT PULL Applied Aurelien Jarno 2 participants 4 messages Jul 17, 2017 – Jul 18, 2017

lore
Share & tools
lore
#0 lore raw

Two additional MIPS patches that have been sent a few weeks ago and which got reviewed.

Thanks,
Aurelien

The following changes since commit 77031ee1ce4c7e5f4b4941535c4912eb2eb3503c:

Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.10-20170717' into staging (2017-07-17 12:52:59 +0100)

are available in the git repository at:

git://git.aurel32.net/qemu.git tags/pull-target-mips-20170717

for you to fetch changes up to 06a57e5cc7ee5292a4915117ebf951e310a28264:

target/mips: optimize WSBH, DSBH and DSHD (2017-07-17 16:48:21 +0200)

----------------------------------------------------------------
Queued target/mips patches

----------------------------------------------------------------
Aurelien Jarno (1):
target/mips: optimize WSBH, DSBH and DSHD

Pavel Dovgalyuk (1):
mips: set CP0 Debug DExcCode for SDBBP instruction

 target/mips/helper.c    |  2 ++
 target/mips/translate.c | 18 ++++++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

[Qemu-devel] [PULL 1/2] mips: set CP0 Debug DExcCode for SDBBP instruction

From: Pavel Dovgalyuk <[email protected]>

This patch fixes setting DExcCode field of CP0 Debug register when SDBBP instruction is executed. According to EJTAG specification, this field must be set to the value 9 (Bp).

Message-id: 20170502120350.3368.92338.stgit@PASHA-ISP

---
 target/mips/helper.c | 2 ++
 1 file changed, 2 insertions(+)
target/mips/helper.c +2 -0
index e359ca3b44..166f0d1243 100644
@@ -627,6 +627,8 @@ void mips_cpu_do_interrupt(CPUState *cs)
         goto set_DEPC;
     case EXCP_DBp:
         env->CP0_Debug |= 1 << CP0DB_DBp;
+        /* Setup DExcCode - SDBBP instruction */
+        env->CP0_Debug = (env->CP0_Debug & ~(0x1fULL << CP0DB_DEC)) | 9 << CP0DB_DEC;
         goto set_DEPC;
     case EXCP_DDBS:
         env->CP0_Debug |= 1 << CP0DB_DDBS;
Signature · 1 line
2.11.0
#2 lore raw

[Qemu-devel] [PULL 2/2] target/mips: optimize WSBH, DSBH and DSHD

In reply to Aurelien Jarno

Use the same mask to avoid having to load two different constants.

---
 target/mips/translate.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
target/mips/translate.c +12 -6
index befb87f814..fe44f2f807 100644
@@ -4572,12 +4572,14 @@ static void gen_bshfl (DisasContext *ctx, uint32_t op2, int rt, int rd)
     case OPC_WSBH:
         {
             TCGv t1 = tcg_temp_new();
+            TCGv t2 = tcg_const_tl(0x00FF00FF);
 
             tcg_gen_shri_tl(t1, t0, 8);
-            tcg_gen_andi_tl(t1, t1, 0x00FF00FF);
+            tcg_gen_and_tl(t1, t1, t2);
+            tcg_gen_and_tl(t0, t0, t2);
             tcg_gen_shli_tl(t0, t0, 8);
-            tcg_gen_andi_tl(t0, t0, ~0x00FF00FF);
             tcg_gen_or_tl(t0, t0, t1);
+            tcg_temp_free(t2);
             tcg_temp_free(t1);
             tcg_gen_ext32s_tl(cpu_gpr[rd], t0);
         }
@@ -4592,27 +4594,31 @@ static void gen_bshfl (DisasContext *ctx, uint32_t op2, int rt, int rd)
     case OPC_DSBH:
         {
             TCGv t1 = tcg_temp_new();
+            TCGv t2 = tcg_const_tl(0x00FF00FF00FF00FFULL);
 
             tcg_gen_shri_tl(t1, t0, 8);
-            tcg_gen_andi_tl(t1, t1, 0x00FF00FF00FF00FFULL);
+            tcg_gen_and_tl(t1, t1, t2);
+            tcg_gen_and_tl(t0, t0, t2);
             tcg_gen_shli_tl(t0, t0, 8);
-            tcg_gen_andi_tl(t0, t0, ~0x00FF00FF00FF00FFULL);
             tcg_gen_or_tl(cpu_gpr[rd], t0, t1);
+            tcg_temp_free(t2);
             tcg_temp_free(t1);
         }
         break;
     case OPC_DSHD:
         {
             TCGv t1 = tcg_temp_new();
+            TCGv t2 = tcg_const_tl(0x0000FFFF0000FFFFULL);
 
             tcg_gen_shri_tl(t1, t0, 16);
-            tcg_gen_andi_tl(t1, t1, 0x0000FFFF0000FFFFULL);
+            tcg_gen_and_tl(t1, t1, t2);
+            tcg_gen_and_tl(t0, t0, t2);
             tcg_gen_shli_tl(t0, t0, 16);
-            tcg_gen_andi_tl(t0, t0, ~0x0000FFFF0000FFFFULL);
             tcg_gen_or_tl(t0, t0, t1);
             tcg_gen_shri_tl(t1, t0, 32);
             tcg_gen_shli_tl(t0, t0, 32);
             tcg_gen_or_tl(cpu_gpr[rd], t0, t1);
+            tcg_temp_free(t2);
             tcg_temp_free(t1);
         }
         break;
Signature · 1 line
2.11.0
#3 lore raw
In reply to Aurelien Jarno
Quoted 25 lines · Aurelien Jarno

Two additional MIPS patches that have been sent a few weeks ago and which got reviewed.

Thanks,
Aurelien

The following changes since commit 77031ee1ce4c7e5f4b4941535c4912eb2eb3503c:

Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.10-20170717' into staging (2017-07-17 12:52:59 +0100)

are available in the git repository at:

git://git.aurel32.net/qemu.git tags/pull-target-mips-20170717

for you to fetch changes up to 06a57e5cc7ee5292a4915117ebf951e310a28264:

target/mips: optimize WSBH, DSBH and DSHD (2017-07-17 16:48:21 +0200)

----------------------------------------------------------------
Queued target/mips patches

----------------------------------------------------------------
Aurelien Jarno (1):
target/mips: optimize WSBH, DSBH and DSHD

Quoted 6 lines

Pavel Dovgalyuk (1):
mips: set CP0 Debug DExcCode for SDBBP instruction

 target/mips/helper.c    |  2 ++
 target/mips/translate.c | 18 ++++++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

Applied, thanks.

-- PMM