All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Janeczek, Craig" <jancraig@amazon.com>
To: Aleksandar Markovic <amarkovic@wavecomp.com>,
	Stefan Markovic <smarkovic@wavecomp.com>,
	Aleksandar Markovic <aleksandar.markovic@rt-rk.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/6] target/mips: MXU: Add missing opcodes/decoding for LX* instructions
Date: Thu, 27 Dec 2018 19:37:40 +0000	[thread overview]
Message-ID: <e23100879dcf440180ca19debf324d37@EX13D12UEA003.ant.amazon.com> (raw)
In-Reply-To: <BN6PR2201MB12515E6A3326FD0F6A769E06C6B60@BN6PR2201MB1251.namprd22.prod.outlook.com>

Yes, both the comment and enum should be updated.

-----Original Message-----
From: Aleksandar Markovic <amarkovic@wavecomp.com> 
Sent: Thursday, December 27, 2018 2:23 PM
To: Janeczek, Craig <jancraig@amazon.com>; Stefan Markovic <smarkovic@wavecomp.com>; Aleksandar Markovic <aleksandar.markovic@rt-rk.com>; qemu-devel@nongnu.org
Subject: Re: [PATCH 1/6] target/mips: MXU: Add missing opcodes/decoding for LX* instructions

> From: Janeczek, Craig <jancraig@amazon.com>
> Sent: Thursday, December 27, 2018 7:50 PM
> To: Aleksandar Markovic; Stefan Markovic; Aleksandar Markovic; qemu-devel@nongnu.org
> Subject: RE: [PATCH 1/6] target/mips: MXU: Add missing opcodes/decoding for LX* instructions
> 
> Yes built a binary testing these instructions and ran it against HW along with a qemu binary with your > patches. The opcodes align with what I mentioned in the email.
> 

I truly appreciate your help.

Just to clarify details, beside correcting comments, does this mean that this code segment:

/*
 * MXU pool 16
 */
enum {
    OPC_MXU_D32SARW  = 0x00,
    OPC_MXU_S32ALN   = 0x01,
    OPC_MXU_S32ALNI  = 0x02,
    OPC_MXU_S32NOR   = 0x03,
    OPC_MXU_S32AND   = 0x04,
    OPC_MXU_S32OR    = 0x05,
    OPC_MXU_S32XOR   = 0x06,
    OPC_MXU_S32LUI   = 0x07,
};

should be corrected to be:

/*
 * MXU pool 16
 */
enum {
    OPC_MXU_D32SARW  = 0x00,
    OPC_MXU_S32ALN   = 0x01,
    OPC_MXU_S32ALNI  = 0x02,
    OPC_MXU_S32LUI   = 0x03,
    OPC_MXU_S32NOR   = 0x04,
    OPC_MXU_S32AND   = 0x05,
    OPC_MXU_S32OR    = 0x06,
    OPC_MXU_S32XOR   = 0x07,
};

and all things will line up for "pool 16"?

Sincerely,
Aleksandar

> -----Original Message-----
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
> Subject: Re: [PATCH 1/6] target/mips: MXU: Add missing opcodes/decoding for LX* instructions
> 
> > > @@ -1663,12 +1663,21 @@ enum {
> > >    *          │                               20..18
> > >    *          ├─ 100111 ─ OPC_MXU__POOL16 ─┬─ 000 ─ OPC_MXU_D32SARW
> > >    *          │                            ├─ 001 ─ OPC_MXU_S32ALN
> > > - *          ├─ 101000 ─ OPC_MXU_LXB      ├─ 010 ─ OPC_MXU_S32ALNI
> > > - *          ├─ 101001 ─ <not assigned>   ├─ 011 ─ OPC_MXU_S32NOR
> > > - *          ├─ 101010 ─ OPC_MXU_S16LDD   ├─ 100 ─ OPC_MXU_S32AND
> > > - *          ├─ 101011 ─ OPC_MXU_S16STD   ├─ 101 ─ OPC_MXU_S32OR
> > > - *          ├─ 101100 ─ OPC_MXU_S16LDI   ├─ 110 ─ OPC_MXU_S32XOR
> > > - *          ├─ 101101 ─ OPC_MXU_S16SDI   └─ 111 ─ OPC_MXU_S32LUI
> > > + *          │                            ├─ 010 ─ OPC_MXU_S32ALNI
> > > + *          │                            ├─ 011 ─ OPC_MXU_S32NOR
> > > + *          │                            ├─ 100 ─ OPC_MXU_S32AND
> > > + *          │                            ├─ 101 ─ OPC_MXU_S32OR
> > > + *          │                            ├─ 110 ─ OPC_MXU_S32XOR
> > > + *          │                            └─ 111 ─ OPC_MXU_S32LUI
> > The opcodes for pool 16 do not look correct. I think the minor bits should look like the following.
> >
> > ┬─ 000 ─ OPC_MXU_D32SARW
> > ├─ 001 ─ OPC_MXU_S32ALN
> > ├─ 010 ─ OPC_MXU_S32ALNI
> > ├─ 011 ─ OPC_MXU_S32LUI
> > ├─ 100 ─ OPC_MXU_S32NOR
> > ├─ 101 ─ OPC_MXU_S32AND
> > ├─ 110 ─ OPC_MXU_S32OR
> > └─ 111 ─ OPC_MXU_S32XOR
> >
> 
> Hi, Craig!
> 
> My primary source for opcodes was the latest Ingenic documentation, from Ingenic's site: (dated June > 2017)
> 
> ftp://ftp.ingenic.com/SOC/M200/X1000_M200_XBurst_ISA_MXU_PM.pdf
> 
> and on page 109 there is a table in the middle of the page that contains codes that are in agreement > with what is currently in QEMU.
> 
> However, I searched more, and in a repository that seems to be derived from Android NDK r9d binutils > tree, in file
> 
> https://github.com/apportable/binutils/blob/master/opcodes/mxu-opc.c
> 
> opcodes are as you said.
> 
> I guess the definitive answer would be to involve tests on hardware, no?
> 
> Thanks for bringing this up!
> 
> Aleksandar
> 
> 
> > > + *          │
> > > + *          │                               7..5
> > > + *          ├─ 101000 ─ OPC_MXU__POOL17 ─┬─ 000 ─ OPC_MXU_LXB
> > > + *          │                            ├─ 001 ─ OPC_MXU_LXH
> > > + *          ├─ 101001 ─ <not assigned>   ├─ 011 ─ OPC_MXU_LXW
> > > + *          ├─ 101010 ─ OPC_MXU_S16LDD   ├─ 100 ─ OPC_MXU_LXBU
> > > + *          ├─ 101011 ─ OPC_MXU_S16STD   └─ 101 ─ OPC_MXU_LXHU
> > > + *          ├─ 101100 ─ OPC_MXU_S16LDI
> > > + *          ├─ 101101 ─ OPC_MXU_S16SDI
> > >    *          ├─ 101110 ─ OPC_MXU_S32M2I
> > >    *          ├─ 101111 ─ OPC_MXU_S32I2M
> > >    *          ├─ 110000 ─ OPC_MXU_D32SLL

  reply	other threads:[~2018-12-27 19:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17 20:04 [Qemu-devel] [PATCH 0/6] target/mips: Amend MXU support Aleksandar Markovic
2018-12-17 20:04 ` [Qemu-devel] [PATCH 1/6] target/mips: MXU: Add missing opcodes/decoding for LX* instructions Aleksandar Markovic
2018-12-18 14:21   ` Stefan Markovic
2018-12-27 17:15     ` Janeczek, Craig
2018-12-27 18:44       ` Aleksandar Markovic
2018-12-27 18:50         ` Janeczek, Craig
2018-12-27 19:23           ` Aleksandar Markovic
2018-12-27 19:37             ` Janeczek, Craig [this message]
2018-12-27 20:12               ` Aleksandar Markovic
2018-12-17 20:04 ` [Qemu-devel] [PATCH 2/6] target/mips: MXU: Add generic naming for optn2 constants Aleksandar Markovic
2018-12-17 20:04 ` [Qemu-devel] [PATCH 3/6] target/mips: MXU: Improve textual description Aleksandar Markovic
2018-12-18 14:30   ` Stefan Markovic
2018-12-17 20:04 ` [Qemu-devel] [PATCH 4/6] target/mips: MXU: Add handlers for logic instructions Aleksandar Markovic
2018-12-18 14:39   ` Stefan Markovic
2018-12-17 20:04 ` [Qemu-devel] [PATCH 5/6] target/mips: MXU: Add handlers for max/min instructions Aleksandar Markovic
2018-12-18 15:05   ` Stefan Markovic
2018-12-27 17:18     ` Janeczek, Craig
2018-12-27 20:14       ` Aleksandar Markovic
2018-12-23 17:22   ` Aleksandar Markovic
2018-12-25 19:34     ` Richard Henderson
2021-03-15 21:26       ` Philippe Mathieu-Daudé
2018-12-17 20:04 ` [Qemu-devel] [PATCH 6/6] target/mips: MXU: Add handlers for an align instruction Aleksandar Markovic
2018-12-18 15:19   ` Stefan Markovic
2018-12-27 21:27 ` [Qemu-devel] [PATCH 0/6] target/mips: Amend MXU support Aleksandar Markovic
2018-12-31 14:40   ` Aleksandar Markovic

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=e23100879dcf440180ca19debf324d37@EX13D12UEA003.ant.amazon.com \
    --to=jancraig@amazon.com \
    --cc=aleksandar.markovic@rt-rk.com \
    --cc=amarkovic@wavecomp.com \
    --cc=qemu-devel@nongnu.org \
    --cc=smarkovic@wavecomp.com \
    /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 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.