All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aleksandar Markovic <amarkovic@wavecomp.com>
To: Mateja Marjanovic <Mateja.Marjanovic@rt-rk.com>,
	Aleksandar Markovic <aleksandar.m.mail@gmail.com>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Aleksandar Rikalo" <arikalo@wavecomp.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH v6 4/4] target/mips: Optimize ILVR.<B|H|W|D> MSA instructions
Date: Tue, 16 Apr 2019 21:20:42 +0000	[thread overview]
Message-ID: <BN6PR2201MB1251458C6A26DEE093C282EEC6240@BN6PR2201MB1251.namprd22.prod.outlook.com> (raw)
In-Reply-To: <bcc405c5-2e96-19a9-123e-bc607c243209@rt-rk.com>

> From: Mateja Marjanovic <Mateja.Marjanovic@rt-rk.com>
> >>
> >> +void helper_msa_ilvr_b(CPUMIPSState *env, uint32_t wd,
> >> +                       uint32_t ws, uint32_t wt)
> >> +{
> >> +    wr_t *pwd = &(env->active_fpu.fpr[wd].wr);
> >> +    wr_t *pws = &(env->active_fpu.fpr[ws].wr);
> >> +    wr_t *pwt = &(env->active_fpu.fpr[wt].wr);
> >> +
> > Why do we use here env->active_fpu.fpr[wd].wr, while for other instructions in
> > this patch, we access msa_wr_d<b|h|w|d[] directly?
> With a pointer to wr_t we have an array of bytes, halfwords, words or
> doublewords
> and can read from them and change them like an ordinary array. In other
> cases
> we use a variable that is TCGv_i64 and would have to use tcg_gen
> functions to
> modify the value of the register. Before my changes in ilvr instruction
> helpers
> env->active_fpu.fpr[wd].wr was used, so I just copy-pasted that.
>

Your answer touches just surface, and doesn't fully answer my question.
I would like you to show deeper understanding of the code you are working
with. You can't just copy/paste without thinking.

Why do majority of MSA helpers use env->active_fpu.fpr[<index>].wr, while
your code mostly reference the MSA register directly? Is this the same
thing? If yes, why all MSA code doesn't use registers directly, which
would certainly be simpler than referencing active_fpu? What is the role
of "active_fpu"? Can it be changed? Can you analyze the underlying
reasons for referencing "active_fpu", and can you claim that it is safe
to circumvent it and reference the MSA registers directly?

Thanks,
Aleksandar

WARNING: multiple messages have this Message-ID (diff)
From: Aleksandar Markovic <amarkovic@wavecomp.com>
To: Mateja Marjanovic <Mateja.Marjanovic@rt-rk.com>,
	Aleksandar Markovic <aleksandar.m.mail@gmail.com>
Cc: "Aleksandar Rikalo" <arikalo@wavecomp.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH v6 4/4] target/mips: Optimize ILVR.<B|H|W|D> MSA instructions
Date: Tue, 16 Apr 2019 21:20:42 +0000	[thread overview]
Message-ID: <BN6PR2201MB1251458C6A26DEE093C282EEC6240@BN6PR2201MB1251.namprd22.prod.outlook.com> (raw)
Message-ID: <20190416212042.hnfyTRIaIwbLcmghrtY24EwhR88hbZBl1CcpDn_dtlE@z> (raw)
In-Reply-To: <bcc405c5-2e96-19a9-123e-bc607c243209@rt-rk.com>

> From: Mateja Marjanovic <Mateja.Marjanovic@rt-rk.com>
> >>
> >> +void helper_msa_ilvr_b(CPUMIPSState *env, uint32_t wd,
> >> +                       uint32_t ws, uint32_t wt)
> >> +{
> >> +    wr_t *pwd = &(env->active_fpu.fpr[wd].wr);
> >> +    wr_t *pws = &(env->active_fpu.fpr[ws].wr);
> >> +    wr_t *pwt = &(env->active_fpu.fpr[wt].wr);
> >> +
> > Why do we use here env->active_fpu.fpr[wd].wr, while for other instructions in
> > this patch, we access msa_wr_d<b|h|w|d[] directly?
> With a pointer to wr_t we have an array of bytes, halfwords, words or
> doublewords
> and can read from them and change them like an ordinary array. In other
> cases
> we use a variable that is TCGv_i64 and would have to use tcg_gen
> functions to
> modify the value of the register. Before my changes in ilvr instruction
> helpers
> env->active_fpu.fpr[wd].wr was used, so I just copy-pasted that.
>

Your answer touches just surface, and doesn't fully answer my question.
I would like you to show deeper understanding of the code you are working
with. You can't just copy/paste without thinking.

Why do majority of MSA helpers use env->active_fpu.fpr[<index>].wr, while
your code mostly reference the MSA register directly? Is this the same
thing? If yes, why all MSA code doesn't use registers directly, which
would certainly be simpler than referencing active_fpu? What is the role
of "active_fpu"? Can it be changed? Can you analyze the underlying
reasons for referencing "active_fpu", and can you claim that it is safe
to circumvent it and reference the MSA registers directly?

Thanks,
Aleksandar


  reply	other threads:[~2019-04-16 21:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 13:14 [Qemu-devel] [PATCH v6 0/4] target/mips: Optimize MSA interleave instructions Mateja Marjanovic
2019-04-04 13:14 ` [Qemu-devel] [PATCH v6 1/4] target/mips: Optimize ILVOD.<B|H|W|D> MSA instructions Mateja Marjanovic
2019-04-04 13:47   ` Philippe Mathieu-Daudé
2019-04-13 16:09   ` Aleksandar Markovic
2019-04-13 16:09     ` Aleksandar Markovic
2019-04-04 13:14 ` [Qemu-devel] [PATCH v6 2/4] target/mips: Optimize ILVEV.<B|H|W|D> " Mateja Marjanovic
2019-04-04 13:42   ` Philippe Mathieu-Daudé
2019-04-04 18:19     ` Aleksandar Markovic
2019-04-04 19:17       ` Philippe Mathieu-Daudé
2019-04-05  0:26         ` Aleksandar Markovic
2019-04-05  0:26           ` Aleksandar Markovic
2019-04-17 12:45     ` Mateja Marjanovic
2019-04-17 12:45       ` Mateja Marjanovic
2019-04-13 16:05   ` Aleksandar Markovic
2019-04-13 16:05     ` Aleksandar Markovic
2019-04-15 13:48     ` Mateja Marjanovic
2019-04-15 13:48       ` Mateja Marjanovic
2019-04-04 13:14 ` [Qemu-devel] [PATCH v6 3/4] target/mips: Optimize ILVL.<B|H|W|D> " Mateja Marjanovic
2019-04-13 16:15   ` Aleksandar Markovic
2019-04-13 16:15     ` Aleksandar Markovic
2019-04-04 13:14 ` [Qemu-devel] [PATCH v6 4/4] target/mips: Optimize ILVR.<B|H|W|D> " Mateja Marjanovic
2019-04-13 16:05   ` Aleksandar Markovic
2019-04-13 16:05     ` Aleksandar Markovic
2019-04-15 11:24     ` Mateja Marjanovic
2019-04-15 11:24       ` Mateja Marjanovic
2019-04-16 21:20       ` Aleksandar Markovic [this message]
2019-04-16 21:20         ` Aleksandar Markovic
2019-04-17  8:16         ` Mateja Marjanovic
2019-04-17  8:16           ` 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=BN6PR2201MB1251458C6A26DEE093C282EEC6240@BN6PR2201MB1251.namprd22.prod.outlook.com \
    --to=amarkovic@wavecomp.com \
    --cc=Mateja.Marjanovic@rt-rk.com \
    --cc=aleksandar.m.mail@gmail.com \
    --cc=arikalo@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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.