All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/4] M68k for 2.13 patches
@ 2018-05-01 13:55 Laurent Vivier
  2018-05-01 13:55 ` [Qemu-devel] [PULL 1/4] m68k: fix subx mem, mem instruction Laurent Vivier
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Laurent Vivier @ 2018-05-01 13:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Laurent Vivier, Thomas Huth, Michael Tokarev

The following changes since commit c2c768500f17fc8cdcfa44d169f089953bb22748:

  Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.13-pull-request' into staging (2018-04-30 10:43:41 +0100)

are available in the Git repository at:

  git://github.com/vivier/qemu-m68k.git tags/m68k-for-2.13-pull-request

for you to fetch changes up to 83dc62f6ed6b4f2afce71d579a630441cca0957c:

  hw/m68k/mcf5208: Fix trivial typo in board description (2018-05-01 15:37:54 +0200)

----------------------------------------------------------------
Some fixes for m68k CPU emulation
including the trivial one from Thomas for mcf5208 (m68k hardware)
----------------------------------------------------------------

Laurent Vivier (2):
  m68k: Fix floatx80_lognp1 (Coverity CID1390587)
  m68k: remove dead code (Coverity CID1390617)

Pavel Dovgalyuk (1):
  m68k: fix subx mem, mem instruction

Thomas Huth (1):
  hw/m68k/mcf5208: Fix trivial typo in board description

 hw/m68k/mcf5208.c       |  2 +-
 target/m68k/softfloat.c | 46 ++++++++++++++++------------------------------
 target/m68k/translate.c |  4 ++--
 3 files changed, 19 insertions(+), 33 deletions(-)

-- 
2.14.3

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

* [Qemu-devel] [PULL 1/4] m68k: fix subx mem, mem instruction
  2018-05-01 13:55 [Qemu-devel] [PULL 0/4] M68k for 2.13 patches Laurent Vivier
@ 2018-05-01 13:55 ` Laurent Vivier
  2018-05-01 13:55 ` [Qemu-devel] [PULL 2/4] m68k: Fix floatx80_lognp1 (Coverity CID1390587) Laurent Vivier
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2018-05-01 13:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Laurent Vivier, Thomas Huth, Michael Tokarev,
	Pavel Dovgalyuk

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

This patch fixes decrement of the pointers for subx mem, mem instructions.
Without the patch pointers are decremented by OS_* constant value instead of
retrieving the corresponding data size and using it as a decrement.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20180418064152.24606.71975.stgit@pasha-VirtualBox>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target/m68k/translate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 6beaf9ed66..e407ba2db3 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -3166,11 +3166,11 @@ DISAS_INSN(subx_mem)
     opsize = insn_opsize(insn);
 
     addr_src = AREG(insn, 0);
-    tcg_gen_subi_i32(addr_src, addr_src, opsize);
+    tcg_gen_subi_i32(addr_src, addr_src, opsize_bytes(opsize));
     src = gen_load(s, opsize, addr_src, 1, IS_USER(s));
 
     addr_dest = AREG(insn, 9);
-    tcg_gen_subi_i32(addr_dest, addr_dest, opsize);
+    tcg_gen_subi_i32(addr_dest, addr_dest, opsize_bytes(opsize));
     dest = gen_load(s, opsize, addr_dest, 1, IS_USER(s));
 
     gen_subx(s, src, dest, opsize);
-- 
2.14.3

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

* [Qemu-devel] [PULL 2/4] m68k: Fix floatx80_lognp1 (Coverity CID1390587)
  2018-05-01 13:55 [Qemu-devel] [PULL 0/4] M68k for 2.13 patches Laurent Vivier
  2018-05-01 13:55 ` [Qemu-devel] [PULL 1/4] m68k: fix subx mem, mem instruction Laurent Vivier
@ 2018-05-01 13:55 ` Laurent Vivier
  2018-05-01 13:55 ` [Qemu-devel] [PULL 3/4] m68k: remove dead code (Coverity CID1390617) Laurent Vivier
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2018-05-01 13:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Laurent Vivier, Thomas Huth, Michael Tokarev

return the result of packFloatx80() instead of
dropping it.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20180430170156.1860-1-laurent@vivier.eu>
---
 target/m68k/softfloat.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/m68k/softfloat.c b/target/m68k/softfloat.c
index dffb371c71..2c069a5efb 100644
--- a/target/m68k/softfloat.c
+++ b/target/m68k/softfloat.c
@@ -334,7 +334,8 @@ floatx80 floatx80_lognp1(floatx80 a, float_status *status)
     if (aSign && aExp >= one_exp) {
         if (aExp == one_exp && aSig == one_sig) {
             float_raise(float_flag_divbyzero, status);
-            packFloatx80(aSign, floatx80_infinity.high, floatx80_infinity.low);
+            return packFloatx80(aSign, floatx80_infinity.high,
+                                floatx80_infinity.low);
         }
         float_raise(float_flag_invalid, status);
         return floatx80_default_nan(status);
-- 
2.14.3

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

* [Qemu-devel] [PULL 3/4] m68k: remove dead code (Coverity CID1390617)
  2018-05-01 13:55 [Qemu-devel] [PULL 0/4] M68k for 2.13 patches Laurent Vivier
  2018-05-01 13:55 ` [Qemu-devel] [PULL 1/4] m68k: fix subx mem, mem instruction Laurent Vivier
  2018-05-01 13:55 ` [Qemu-devel] [PULL 2/4] m68k: Fix floatx80_lognp1 (Coverity CID1390587) Laurent Vivier
@ 2018-05-01 13:55 ` Laurent Vivier
  2018-05-01 13:55 ` [Qemu-devel] [PULL 4/4] hw/m68k/mcf5208: Fix trivial typo in board description Laurent Vivier
  2018-05-01 15:30 ` [Qemu-devel] [PULL 0/4] M68k for 2.13 patches Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2018-05-01 13:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Laurent Vivier, Thomas Huth, Michael Tokarev

floatx80_sin() and floatx80_cos() are derived from one
sincos() function. They have both unused code coming from
their common origin. Remove it.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20180430170156.1860-2-laurent@vivier.eu>
---
 target/m68k/softfloat.c | 43 ++++++++++++++-----------------------------
 1 file changed, 14 insertions(+), 29 deletions(-)

diff --git a/target/m68k/softfloat.c b/target/m68k/softfloat.c
index 2c069a5efb..e41b07d042 100644
--- a/target/m68k/softfloat.c
+++ b/target/m68k/softfloat.c
@@ -1497,7 +1497,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
     int32_t compact, l, n, j;
     floatx80 fp0, fp1, fp2, fp3, fp4, fp5, x, invtwopi, twopi1, twopi2;
     float32 posneg1, twoto63;
-    flag adjn, endflag;
+    flag endflag;
 
     aSig = extractFloatx80Frac(a);
     aExp = extractFloatx80Exp(a);
@@ -1515,8 +1515,6 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
         return packFloatx80(aSign, 0, 0);
     }
 
-    adjn = 0;
-
     user_rnd_mode = status->float_rounding_mode;
     user_rnd_prec = status->floatx80_rounding_precision;
     status->float_rounding_mode = float_round_nearest_even;
@@ -1591,14 +1589,8 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
             status->float_rounding_mode = user_rnd_mode;
             status->floatx80_rounding_precision = user_rnd_prec;
 
-            if (adjn) {
-                /* COSTINY */
-                a = floatx80_sub(fp0, float32_to_floatx80(
-                                 make_float32(0x00800000), status), status);
-            } else {
-                /* SINTINY */
-                a = floatx80_move(a, status);
-            }
+            /* SINTINY */
+            a = floatx80_move(a, status);
             float_raise(float_flag_inexact, status);
 
             return a;
@@ -1616,7 +1608,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
                            status); /* FP0 IS R = (X-Y1)-Y2 */
 
     sincont:
-        if ((n + adjn) & 1) {
+        if (n & 1) {
             /* COSPOLY */
             fp0 = floatx80_mul(fp0, fp0, status); /* FP0 IS S */
             fp1 = floatx80_mul(fp0, fp0, status); /* FP1 IS T */
@@ -1629,7 +1621,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
             xExp = extractFloatx80Exp(fp0);
             xSig = extractFloatx80Frac(fp0);
 
-            if (((n + adjn) >> 1) & 1) {
+            if ((n >> 1) & 1) {
                 xSign ^= 1;
                 posneg1 = make_float32(0xBF800000); /* -1 */
             } else {
@@ -1681,7 +1673,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
             xExp = extractFloatx80Exp(fp0);
             xSig = extractFloatx80Frac(fp0);
 
-            xSign ^= ((n + adjn) >> 1) & 1; /* X IS NOW R'= SGN*R */
+            xSign ^= (n >> 1) & 1; /* X IS NOW R'= SGN*R */
 
             fp0 = floatx80_mul(fp0, fp0, status); /* FP0 IS S */
             fp1 = floatx80_mul(fp0, fp0, status); /* FP1 IS T */
@@ -1744,7 +1736,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
     int32_t compact, l, n, j;
     floatx80 fp0, fp1, fp2, fp3, fp4, fp5, x, invtwopi, twopi1, twopi2;
     float32 posneg1, twoto63;
-    flag adjn, endflag;
+    flag endflag;
 
     aSig = extractFloatx80Frac(a);
     aExp = extractFloatx80Exp(a);
@@ -1762,8 +1754,6 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
         return packFloatx80(0, one_exp, one_sig);
     }
 
-    adjn = 1;
-
     user_rnd_mode = status->float_rounding_mode;
     user_rnd_prec = status->floatx80_rounding_precision;
     status->float_rounding_mode = float_round_nearest_even;
@@ -1837,15 +1827,10 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
             status->float_rounding_mode = user_rnd_mode;
             status->floatx80_rounding_precision = user_rnd_prec;
 
-            if (adjn) {
-                /* COSTINY */
-                a = floatx80_sub(fp0, float32_to_floatx80(
-                                 make_float32(0x00800000), status),
-                                 status);
-            } else {
-                /* SINTINY */
-                a = floatx80_move(a, status);
-            }
+            /* COSTINY */
+            a = floatx80_sub(fp0, float32_to_floatx80(
+                             make_float32(0x00800000), status),
+                             status);
             float_raise(float_flag_inexact, status);
 
             return a;
@@ -1863,7 +1848,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
                            status); /* FP0 IS R = (X-Y1)-Y2 */
 
     sincont:
-        if ((n + adjn) & 1) {
+        if ((n + 1) & 1) {
             /* COSPOLY */
             fp0 = floatx80_mul(fp0, fp0, status); /* FP0 IS S */
             fp1 = floatx80_mul(fp0, fp0, status); /* FP1 IS T */
@@ -1876,7 +1861,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
             xExp = extractFloatx80Exp(fp0);
             xSig = extractFloatx80Frac(fp0);
 
-            if (((n + adjn) >> 1) & 1) {
+            if (((n + 1) >> 1) & 1) {
                 xSign ^= 1;
                 posneg1 = make_float32(0xBF800000); /* -1 */
             } else {
@@ -1927,7 +1912,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
             xExp = extractFloatx80Exp(fp0);
             xSig = extractFloatx80Frac(fp0);
 
-            xSign ^= ((n + adjn) >> 1) & 1; /* X IS NOW R'= SGN*R */
+            xSign ^= ((n + 1) >> 1) & 1; /* X IS NOW R'= SGN*R */
 
             fp0 = floatx80_mul(fp0, fp0, status); /* FP0 IS S */
             fp1 = floatx80_mul(fp0, fp0, status); /* FP1 IS T */
-- 
2.14.3

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

* [Qemu-devel] [PULL 4/4] hw/m68k/mcf5208: Fix trivial typo in board description
  2018-05-01 13:55 [Qemu-devel] [PULL 0/4] M68k for 2.13 patches Laurent Vivier
                   ` (2 preceding siblings ...)
  2018-05-01 13:55 ` [Qemu-devel] [PULL 3/4] m68k: remove dead code (Coverity CID1390617) Laurent Vivier
@ 2018-05-01 13:55 ` Laurent Vivier
  2018-05-01 15:30 ` [Qemu-devel] [PULL 0/4] M68k for 2.13 patches Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2018-05-01 13:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Laurent Vivier, Thomas Huth, Michael Tokarev

From: Thomas Huth <huth@tuxfamily.org>

It's the MCF5208 evaluation board, not the MCF5206 eval board.

Signed-off-by: Thomas Huth <huth@tuxfamily.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20180429094002.3293c9de@thl530.multi.box>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/m68k/mcf5208.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
index 7aca58542e..ae3dcc98c3 100644
--- a/hw/m68k/mcf5208.c
+++ b/hw/m68k/mcf5208.c
@@ -315,7 +315,7 @@ static void mcf5208evb_init(MachineState *machine)
 
 static void mcf5208evb_machine_init(MachineClass *mc)
 {
-    mc->desc = "MCF5206EVB";
+    mc->desc = "MCF5208EVB";
     mc->init = mcf5208evb_init;
     mc->is_default = 1;
     mc->default_cpu_type = M68K_CPU_TYPE_NAME("m5208");
-- 
2.14.3

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

* Re: [Qemu-devel] [PULL 0/4] M68k for 2.13 patches
  2018-05-01 13:55 [Qemu-devel] [PULL 0/4] M68k for 2.13 patches Laurent Vivier
                   ` (3 preceding siblings ...)
  2018-05-01 13:55 ` [Qemu-devel] [PULL 4/4] hw/m68k/mcf5208: Fix trivial typo in board description Laurent Vivier
@ 2018-05-01 15:30 ` Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2018-05-01 15:30 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: QEMU Developers, QEMU Trivial, Thomas Huth, Michael Tokarev

On 1 May 2018 at 14:55, Laurent Vivier <laurent@vivier.eu> wrote:
> The following changes since commit c2c768500f17fc8cdcfa44d169f089953bb22748:
>
>   Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.13-pull-request' into staging (2018-04-30 10:43:41 +0100)
>
> are available in the Git repository at:
>
>   git://github.com/vivier/qemu-m68k.git tags/m68k-for-2.13-pull-request
>
> for you to fetch changes up to 83dc62f6ed6b4f2afce71d579a630441cca0957c:
>
>   hw/m68k/mcf5208: Fix trivial typo in board description (2018-05-01 15:37:54 +0200)
>
> ----------------------------------------------------------------
> Some fixes for m68k CPU emulation
> including the trivial one from Thomas for mcf5208 (m68k hardware)
> ----------------------------------------------------------------
>
> Laurent Vivier (2):
>   m68k: Fix floatx80_lognp1 (Coverity CID1390587)
>   m68k: remove dead code (Coverity CID1390617)
>
> Pavel Dovgalyuk (1):
>   m68k: fix subx mem, mem instruction
>
> Thomas Huth (1):
>   hw/m68k/mcf5208: Fix trivial typo in board description
>

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2018-05-01 15:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-01 13:55 [Qemu-devel] [PULL 0/4] M68k for 2.13 patches Laurent Vivier
2018-05-01 13:55 ` [Qemu-devel] [PULL 1/4] m68k: fix subx mem, mem instruction Laurent Vivier
2018-05-01 13:55 ` [Qemu-devel] [PULL 2/4] m68k: Fix floatx80_lognp1 (Coverity CID1390587) Laurent Vivier
2018-05-01 13:55 ` [Qemu-devel] [PULL 3/4] m68k: remove dead code (Coverity CID1390617) Laurent Vivier
2018-05-01 13:55 ` [Qemu-devel] [PULL 4/4] hw/m68k/mcf5208: Fix trivial typo in board description Laurent Vivier
2018-05-01 15:30 ` [Qemu-devel] [PULL 0/4] M68k for 2.13 patches Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.