All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aleksandar Markovic <amarkovic@wavecomp.com>
To: Mateja Marjanovic <Mateja.Marjanovic@rt-rk.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "aurelien@aurel32.net" <aurelien@aurel32.net>,
	Aleksandar Rikalo <arikalo@wavecomp.com>
Subject: Re: [Qemu-devel] [PATCH v4 5/5] target/mips: Refactor and fix INSERT.<B|H|W|D> instructions
Date: Wed, 3 Apr 2019 12:12:21 +0000	[thread overview]
Message-ID: <BN6PR2201MB12513ADADA13DA0F9D19D0F7C6570@BN6PR2201MB1251.namprd22.prod.outlook.com> (raw)
In-Reply-To: <4aa5f2b4-5288-ef42-1a56-f427a779ab60@rt-rk.com>

> From: Mateja Marjanovic <Mateja.Marjanovic@rt-rk.com>
> Subject: Re: [PATCH v4 5/5] target/mips: Refactor and fix INSERT.<B|H|W|D> instructions
> 
> On 2.4.19. 22:50, Aleksandar Markovic wrote:
> >> From: Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
> >> Subject: [PATCH v4 5/5] target/mips: Refactor and fix INSERT.<B|H|W|D> instructions
> >>
> >> From: Mateja Marjanovic <Mateja.Marjanovic@rt-rk.com>
> >>
> >> The old version of the helper for the INSERT.<B|H|W|D> MSA instructions
> >> has been replaced with four helpers that don't use switch, and change
> >> the endianness of the given index, when executed on a big endian host.
> >>
> >> Signed-off-by: Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
> >> ---
> > ...
> >
> >
> >> +    n %= 16;
> > Mateja, could you just clarify what is the purpose of this line (and
> > similar three lines involving "%=")? It looks to me that n is already
> > limited here to be between 0 and 15, isn't it? (that follows from the
> > source code of gen_msa_elm().) What made you insert this line,
> > as it stands?
> 
> It was
> 
> n %= DF_ELEMENTS(df);
> 
> but when I deleted the df argument, so it had to be done like
> this. I think it's a matter of precaution (in case a number
> greater than 15, or 8... is passed as an argument).

Oh, I see.
 
At this moment, I think a more appropriate code would be:

assert(n < 16)

The whole set of functions decoding this group of instructions is
too complicated (several layers, repeated calculations), and could
be further simplified. But let's say that would be outside of the
scope of this patch and series. Your series, in fact, begins that
simplification by removing redundant decoding of "df" in helpers,
so it is a good step towards better code organization, and we'll
leave more detailed cleanup for some future endeavors.

Yours,
Aleksandar

  reply	other threads:[~2019-04-03 12:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02 13:43 [Qemu-devel] [PATCH v4 0/5] target/mips: Fix support for MSA instructions on a big endian host Mateja Marjanovic
2019-04-02 13:43 ` [Qemu-devel] [PATCH v4 1/5] target/mips: Fix MSA instructions LD.<B|H|W|D> on " Mateja Marjanovic
2019-04-02 20:38   ` Aleksandar Markovic
2019-04-02 13:43 ` [Qemu-devel] [PATCH v4 2/5] target/mips: Fix MSA instructions ST.<B|H|W|D> " Mateja Marjanovic
2019-04-02 20:39   ` Aleksandar Markovic
2019-05-20 12:59   ` Aleksandar Markovic
2019-05-20 13:07     ` Mateja Marjanovic
2019-04-02 13:43 ` [Qemu-devel] [PATCH v4 3/5] target/mips: Refactor and fix COPY_S.<B|H|W|D> instructions Mateja Marjanovic
2019-05-18 15:47   ` Aleksandar Markovic
2019-04-02 13:43 ` [Qemu-devel] [PATCH v4 4/5] target/mips: Refactor and fix COPY_U.<B|H|W> instructions Mateja Marjanovic
2019-05-18 15:47   ` Aleksandar Markovic
2019-04-02 13:43 ` [Qemu-devel] [PATCH v4 5/5] target/mips: Refactor and fix INSERT.<B|H|W|D> instructions Mateja Marjanovic
2019-04-02 20:50   ` Aleksandar Markovic
2019-04-03  8:37     ` Mateja Marjanovic
2019-04-03 12:12       ` Aleksandar Markovic [this message]
2019-05-19  5:25   ` Aleksandar Markovic
2019-05-20 10:24     ` Mateja Marjanovic

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=BN6PR2201MB12513ADADA13DA0F9D19D0F7C6570@BN6PR2201MB1251.namprd22.prod.outlook.com \
    --to=amarkovic@wavecomp.com \
    --cc=Mateja.Marjanovic@rt-rk.com \
    --cc=arikalo@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    /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.