All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding
@ 2012-11-14  2:49 陳韋任 (Wei-Ren Chen)
  2012-11-14  5:38 ` Jia Liu
  2012-11-14 16:45 ` Aurelien Jarno
  0 siblings, 2 replies; 10+ messages in thread
From: 陳韋任 (Wei-Ren Chen) @ 2012-11-14  2:49 UTC (permalink / raw)
  To: qemu-trivial; +Cc: chenwj

Hi all,

  While reading microMIPS decoding, I found a possible wrong opcode
encoding. According to [1] page 337, the bits 13..12 for MULTU is
0x01 rather than 0x00. Please review, thanks.

[1] MIPS Architecture for Programmers VolumeIV-e: The MIPS DSP
    Application-Specific Extension to the microMIPS32 Architecture

Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
---
 target-mips/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-mips/translate.c b/target-mips/translate.c
index f6fc0c2..01b48fa 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -10385,7 +10385,7 @@ enum {
 
     /* bits 13..12 for 0x32 */
     MULT_ACC = 0x0,
-    MULTU_ACC = 0x0,
+    MULTU_ACC = 0x1,
 
     /* bits 15..12 for 0x2c */
     SEB = 0x2,
-- 
1.7.12.3


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

* Re: [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding
  2012-11-14  2:49 [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding 陳韋任 (Wei-Ren Chen)
@ 2012-11-14  5:38 ` Jia Liu
  2012-11-14 16:56   ` Aurelien Jarno
  2012-11-14 16:45 ` Aurelien Jarno
  1 sibling, 1 reply; 10+ messages in thread
From: Jia Liu @ 2012-11-14  5:38 UTC (permalink / raw)
  To: 陳韋任 (Wei-Ren Chen); +Cc: qemu-trivial

Hi guys,

On Nov 14, 2012, at 10:49 AM, 陳韋任 (Wei-Ren Chen) <chenwj@iis.sinica.edu.tw> wrote:

> Hi all,
> 
>  While reading microMIPS decoding, I found a possible wrong opcode
> encoding. According to [1] page 337, the bits 13..12 for MULTU is
> 0x01 rather than 0x00. Please review, thanks.
> 
> [1] MIPS Architecture for Programmers VolumeIV-e: The MIPS DSP
>    Application-Specific Extension to the microMIPS32 Architecture
> 
> Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
> ---
> target-mips/translate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target-mips/translate.c b/target-mips/translate.c
> index f6fc0c2..01b48fa 100644
> --- a/target-mips/translate.c
> +++ b/target-mips/translate.c
> @@ -10385,7 +10385,7 @@ enum {
> 
>     /* bits 13..12 for 0x32 */
>     MULT_ACC = 0x0,
> -    MULTU_ACC = 0x0,
> +    MULTU_ACC = 0x1,
> 
>     /* bits 15..12 for 0x2c */
>     SEB = 0x2,
> -- 
> 1.7.12.3


try this, it is a example using exist frame.

diff --git a/target-mips/translate.c b/target-mips/translate.c
index f6fc0c2..04b2aae 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -10371,6 +10371,8 @@ enum {
     MFC0 = 0x03,
     MTC0 = 0x0b,
 
+    MICRODSP_ABSQ_S_QB_OP = 0x04;
+
     /* bits 13..12 for 0x01 */
     MFHI_ACC = 0x0,
     MFLO_ACC = 0x1,
@@ -10452,6 +10454,9 @@ enum {
     MFLO32 = 0x1,
     MTHI32 = 0x2,
     MTLO32 = 0x3,
+
+    /* bits 15..12 for MICRODSP_ABSQ_S_QB_OP */
+    MICRODSP_ABSQ_S_QB = 0x00;
 };
 
 /* POOL32B encoding of minor opcode field (bits 15..12) */
@@ -11274,6 +11279,14 @@ static void gen_pool32axf (CPUMIPSState *env, DisasContext *ctx, int rt, int rs,
             goto pool32axf_invalid;
         }
         break;
+    case MICRODSP_ABSQ_S_QB_OP:
+        switch (minor) {
+        case MICRODSP_ABSQ_S_QB: // ABSQ_S_QB
+            break;
+        default:
+            goto pool32axf_invalid;
+        }
+        break;
     default:
     pool32axf_invalid:
         MIPS_INVAL("pool32axf");

Regards,
Jia.

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

* Re: [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding
  2012-11-14  2:49 [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding 陳韋任 (Wei-Ren Chen)
  2012-11-14  5:38 ` Jia Liu
@ 2012-11-14 16:45 ` Aurelien Jarno
  2012-11-14 23:57   ` 陳韋任 (Wei-Ren Chen)
  2012-11-15  1:17   ` 陳韋任 (Wei-Ren Chen)
  1 sibling, 2 replies; 10+ messages in thread
From: Aurelien Jarno @ 2012-11-14 16:45 UTC (permalink / raw)
  To: 陳韋任 (Wei-Ren Chen); +Cc: qemu-trivial

On Wed, Nov 14, 2012 at 10:49:55AM +0800, 陳韋任 (Wei-Ren Chen) wrote:
> Hi all,
> 
>   While reading microMIPS decoding, I found a possible wrong opcode
> encoding. According to [1] page 337, the bits 13..12 for MULTU is
> 0x01 rather than 0x00. Please review, thanks.
> 
> [1] MIPS Architecture for Programmers VolumeIV-e: The MIPS DSP
>     Application-Specific Extension to the microMIPS32 Architecture

This is indeed correct, but I guess the page you meant is 166. Page 337
refers to the original MULTU instruction from the MIPS Architecture for
Programmers Volume II-B: The microMIPS32 Instruction Set.

On the other the microMIPS32 encoding for DSP instruction is not yet
supported.


> Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
> ---
>  target-mips/translate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target-mips/translate.c b/target-mips/translate.c
> index f6fc0c2..01b48fa 100644
> --- a/target-mips/translate.c
> +++ b/target-mips/translate.c
> @@ -10385,7 +10385,7 @@ enum {
>  
>      /* bits 13..12 for 0x32 */
>      MULT_ACC = 0x0,
> -    MULTU_ACC = 0x0,
> +    MULTU_ACC = 0x1,
>  
>      /* bits 15..12 for 0x2c */
>      SEB = 0x2,
> -- 
> 1.7.12.3
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net


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

* Re: [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding
  2012-11-14  5:38 ` Jia Liu
@ 2012-11-14 16:56   ` Aurelien Jarno
  2012-11-14 23:51     ` 陳韋任 (Wei-Ren Chen)
  0 siblings, 1 reply; 10+ messages in thread
From: Aurelien Jarno @ 2012-11-14 16:56 UTC (permalink / raw)
  To: Jia Liu; +Cc: qemu-trivial, 陳韋任 (Wei-Ren Chen)

On Wed, Nov 14, 2012 at 01:38:44PM +0800, Jia Liu wrote:
> Hi guys,
> 
> On Nov 14, 2012, at 10:49 AM, 陳韋任 (Wei-Ren Chen) <chenwj@iis.sinica.edu.tw> wrote:
> 
> > Hi all,
> > 
> >  While reading microMIPS decoding, I found a possible wrong opcode
> > encoding. According to [1] page 337, the bits 13..12 for MULTU is
> > 0x01 rather than 0x00. Please review, thanks.
> > 
> > [1] MIPS Architecture for Programmers VolumeIV-e: The MIPS DSP
> >    Application-Specific Extension to the microMIPS32 Architecture
> > 
> > Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
> > ---
> > target-mips/translate.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/target-mips/translate.c b/target-mips/translate.c
> > index f6fc0c2..01b48fa 100644
> > --- a/target-mips/translate.c
> > +++ b/target-mips/translate.c
> > @@ -10385,7 +10385,7 @@ enum {
> > 
> >     /* bits 13..12 for 0x32 */
> >     MULT_ACC = 0x0,
> > -    MULTU_ACC = 0x0,
> > +    MULTU_ACC = 0x1,
> > 
> >     /* bits 15..12 for 0x2c */
> >     SEB = 0x2,
> > -- 
> > 1.7.12.3
> 
> 
> try this, it is a example using exist frame.
> 
> diff --git a/target-mips/translate.c b/target-mips/translate.c
> index f6fc0c2..04b2aae 100644
> --- a/target-mips/translate.c
> +++ b/target-mips/translate.c
> @@ -10371,6 +10371,8 @@ enum {
>      MFC0 = 0x03,
>      MTC0 = 0x0b,
>  
> +    MICRODSP_ABSQ_S_QB_OP = 0x04;
> +
>      /* bits 13..12 for 0x01 */
>      MFHI_ACC = 0x0,
>      MFLO_ACC = 0x1,
> @@ -10452,6 +10454,9 @@ enum {
>      MFLO32 = 0x1,
>      MTHI32 = 0x2,
>      MTLO32 = 0x3,
> +
> +    /* bits 15..12 for MICRODSP_ABSQ_S_QB_OP */
> +    MICRODSP_ABSQ_S_QB = 0x00;
>  };
>  
>  /* POOL32B encoding of minor opcode field (bits 15..12) */
> @@ -11274,6 +11279,14 @@ static void gen_pool32axf (CPUMIPSState *env, DisasContext *ctx, int rt, int rs,
>              goto pool32axf_invalid;
>          }
>          break;
> +    case MICRODSP_ABSQ_S_QB_OP:
> +        switch (minor) {
> +        case MICRODSP_ABSQ_S_QB: // ABSQ_S_QB
> +            break;
> +        default:
> +            goto pool32axf_invalid;
> +        }
> +        break;
>      default:
>      pool32axf_invalid:
>          MIPS_INVAL("pool32axf");
> 

I don't really understand what this patch is supposed to do compared to
the original bug report and patch.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net


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

* Re: [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding
  2012-11-14 16:56   ` Aurelien Jarno
@ 2012-11-14 23:51     ` 陳韋任 (Wei-Ren Chen)
  0 siblings, 0 replies; 10+ messages in thread
From: 陳韋任 (Wei-Ren Chen) @ 2012-11-14 23:51 UTC (permalink / raw)
  To: Aurelien Jarno
  Cc: qemu-trivial, Jia Liu, 陳韋任 (Wei-Ren Chen)

Hi Aurelien,

> I don't really understand what this patch is supposed to do compared to
> the original bug report and patch.

  He just replyed to the wrong mail, never mind.

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj


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

* Re: [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding
  2012-11-14 16:45 ` Aurelien Jarno
@ 2012-11-14 23:57   ` 陳韋任 (Wei-Ren Chen)
  2012-11-15 13:53     ` Aurelien Jarno
  2012-11-15  1:17   ` 陳韋任 (Wei-Ren Chen)
  1 sibling, 1 reply; 10+ messages in thread
From: 陳韋任 (Wei-Ren Chen) @ 2012-11-14 23:57 UTC (permalink / raw)
  To: Aurelien Jarno; +Cc: qemu-trivial, 陳韋任 (Wei-Ren Chen)

On Wed, Nov 14, 2012 at 05:45:21PM +0100, Aurelien Jarno wrote:
> On Wed, Nov 14, 2012 at 10:49:55AM +0800, 陳韋任 (Wei-Ren Chen) wrote:
> > Hi all,
> > 
> >   While reading microMIPS decoding, I found a possible wrong opcode
> > encoding. According to [1] page 337, the bits 13..12 for MULTU is
> > 0x01 rather than 0x00. Please review, thanks.
> > 
> > [1] MIPS Architecture for Programmers VolumeIV-e: The MIPS DSP
> >     Application-Specific Extension to the microMIPS32 Architecture
> 
> This is indeed correct, but I guess the page you meant is 166. Page 337
> refers to the original MULTU instruction from the MIPS Architecture for
> Programmers Volume II-B: The microMIPS32 Instruction Set.
> 
> On the other the microMIPS32 encoding for DSP instruction is not yet
> supported.

  Maybe we can start cleanup it a little bit. ;) Is this OK to commit?

Regards,
chenwj 

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj


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

* Re: [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding
  2012-11-14 16:45 ` Aurelien Jarno
  2012-11-14 23:57   ` 陳韋任 (Wei-Ren Chen)
@ 2012-11-15  1:17   ` 陳韋任 (Wei-Ren Chen)
  2012-11-15 13:56     ` Aurelien Jarno
  1 sibling, 1 reply; 10+ messages in thread
From: 陳韋任 (Wei-Ren Chen) @ 2012-11-15  1:17 UTC (permalink / raw)
  To: Aurelien Jarno
  Cc: qemu-trivial, Jia Liu, 陳韋任 (Wei-Ren Chen)

Hi Aurelien,

  off the topic. Do you happen to know if GCC or whatever compiler
support microMIPS? I don't see any option used to produce microMIPS
code on GCC manual [1]. Thanks.

Regards,
chenwj

[1] http://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj


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

* Re: [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding
  2012-11-14 23:57   ` 陳韋任 (Wei-Ren Chen)
@ 2012-11-15 13:53     ` Aurelien Jarno
  2012-11-16  1:26       ` 陳韋任 (Wei-Ren Chen)
  0 siblings, 1 reply; 10+ messages in thread
From: Aurelien Jarno @ 2012-11-15 13:53 UTC (permalink / raw)
  To: 陳韋任 (Wei-Ren Chen); +Cc: qemu-trivial

On Thu, Nov 15, 2012 at 07:57:04AM +0800, 陳韋任 (Wei-Ren Chen) wrote:
> On Wed, Nov 14, 2012 at 05:45:21PM +0100, Aurelien Jarno wrote:
> > On Wed, Nov 14, 2012 at 10:49:55AM +0800, 陳韋任 (Wei-Ren Chen) wrote:
> > > Hi all,
> > > 
> > >   While reading microMIPS decoding, I found a possible wrong opcode
> > > encoding. According to [1] page 337, the bits 13..12 for MULTU is
> > > 0x01 rather than 0x00. Please review, thanks.
> > > 
> > > [1] MIPS Architecture for Programmers VolumeIV-e: The MIPS DSP
> > >     Application-Specific Extension to the microMIPS32 Architecture
> > 
> > This is indeed correct, but I guess the page you meant is 166. Page 337
> > refers to the original MULTU instruction from the MIPS Architecture for
> > Programmers Volume II-B: The microMIPS32 Instruction Set.
> > 
> > On the other the microMIPS32 encoding for DSP instruction is not yet
> > supported.
> 
>   Maybe we can start cleanup it a little bit. ;) Is this OK to commit?
> 

My point was that the patch what correct, but not the comment. I have
committed it after fixing the comment.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net


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

* Re: [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding
  2012-11-15  1:17   ` 陳韋任 (Wei-Ren Chen)
@ 2012-11-15 13:56     ` Aurelien Jarno
  0 siblings, 0 replies; 10+ messages in thread
From: Aurelien Jarno @ 2012-11-15 13:56 UTC (permalink / raw)
  To: 陳韋任 (Wei-Ren Chen); +Cc: qemu-trivial, Jia Liu

On Thu, Nov 15, 2012 at 09:17:20AM +0800, 陳韋任 (Wei-Ren Chen) wrote:
> Hi Aurelien,
> 
>   off the topic. Do you happen to know if GCC or whatever compiler
> support microMIPS? I don't see any option used to produce microMIPS
> code on GCC manual [1]. Thanks.
> 

There are some patches floating around to add a -mmicromips option to
GCC, but they haven't been merged yet.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net


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

* Re: [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding
  2012-11-15 13:53     ` Aurelien Jarno
@ 2012-11-16  1:26       ` 陳韋任 (Wei-Ren Chen)
  0 siblings, 0 replies; 10+ messages in thread
From: 陳韋任 (Wei-Ren Chen) @ 2012-11-16  1:26 UTC (permalink / raw)
  To: Aurelien Jarno; +Cc: qemu-trivial, 陳韋任 (Wei-Ren Chen)

On Thu, Nov 15, 2012 at 02:53:38PM +0100, Aurelien Jarno wrote:
> On Thu, Nov 15, 2012 at 07:57:04AM +0800, 陳韋任 (Wei-Ren Chen) wrote:
> > On Wed, Nov 14, 2012 at 05:45:21PM +0100, Aurelien Jarno wrote:
> > > On Wed, Nov 14, 2012 at 10:49:55AM +0800, 陳韋任 (Wei-Ren Chen) wrote:
> > > > Hi all,
> > > > 
> > > >   While reading microMIPS decoding, I found a possible wrong opcode
> > > > encoding. According to [1] page 337, the bits 13..12 for MULTU is
> > > > 0x01 rather than 0x00. Please review, thanks.
> > > > 
> > > > [1] MIPS Architecture for Programmers VolumeIV-e: The MIPS DSP
> > > >     Application-Specific Extension to the microMIPS32 Architecture
> > > 
> > > This is indeed correct, but I guess the page you meant is 166. Page 337
> > > refers to the original MULTU instruction from the MIPS Architecture for
> > > Programmers Volume II-B: The microMIPS32 Instruction Set.
> > > 
> > > On the other the microMIPS32 encoding for DSP instruction is not yet
> > > supported.
> > 
> >   Maybe we can start cleanup it a little bit. ;) Is this OK to commit?
> > 
> 
> My point was that the patch what correct, but not the comment. I have
> committed it after fixing the comment.

  I saw your commit, thanks. btw, I found codesourcery MIPS GCC has a
option called "-mmicromips". Would you mind confirm this option does
work for me?

Regards,
chenwj
 
-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj


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

end of thread, other threads:[~2012-11-16  1:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-14  2:49 [Qemu-trivial] [PATCH] Possible wrong microMIPS opcode encoding 陳韋任 (Wei-Ren Chen)
2012-11-14  5:38 ` Jia Liu
2012-11-14 16:56   ` Aurelien Jarno
2012-11-14 23:51     ` 陳韋任 (Wei-Ren Chen)
2012-11-14 16:45 ` Aurelien Jarno
2012-11-14 23:57   ` 陳韋任 (Wei-Ren Chen)
2012-11-15 13:53     ` Aurelien Jarno
2012-11-16  1:26       ` 陳韋任 (Wei-Ren Chen)
2012-11-15  1:17   ` 陳韋任 (Wei-Ren Chen)
2012-11-15 13:56     ` Aurelien Jarno

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.