From: Richard Henderson <rth@twiddle.net>
To: Yongbok Kim <yongbok.kim@imgtec.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, leon.alrae@imgtec.com, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH v4 3/3] target-mips: Misaligned memory accesses for MSA
Date: Wed, 20 May 2015 10:25:40 -0700 [thread overview]
Message-ID: <555CC394.5080501@twiddle.net> (raw)
In-Reply-To: <1432134765-7680-4-git-send-email-yongbok.kim@imgtec.com>
On 05/20/2015 08:12 AM, Yongbok Kim wrote:
> +#define MSA_LD_DF(DF, TYPE, LD_INSN, ...) \
> +void helper_msa_ld_ ## TYPE(CPUMIPSState *env, uint32_t wd, uint32_t rs,\
> + int32_t s10) \
> +{ \
> + wr_t *pwd = &(env->active_fpu.fpr[wd].wr); \
> + wr_t wx; \
> + target_ulong addr = env->active_tc.gpr[rs] + (s10 << DF); \
It would be nice to clean this up a bit more. For instance, don't pass the
register number and offset. Instead, compute the address properly during
translation and pass that down.
> + int i; \
> + for (i = 0; i < DF_ELEMENTS(DF); i++) { \
> + wx.TYPE[i] = LD_INSN(env, addr + (i << DF), ##__VA_ARGS__); \
Why the varargs? They're the same all the time.
> +MSA_LD_DF(DF_BYTE, b, helper_ret_ldub_mmu, \
> + make_memop_idx(MO_UNALN, cpu_mmu_index(env)), GETRA())
I would prefer it if you'd pass the full and proper TCGMemOp.
I.e. MO_TE | MO_{8,16,32,64} | MO_UNALN.
And you might as well hoist that out of the load/store loops.
r~
next prev parent reply other threads:[~2015-05-20 17:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 15:12 [Qemu-devel] [PATCH v4 0/3] target-mips: Add support for misaligned accesses Yongbok Kim
2015-05-20 15:12 ` [Qemu-devel] [PATCH v4 1/3] target-mips: Misaligned memory accesses for R6 Yongbok Kim
2015-05-20 17:09 ` Richard Henderson
2015-05-21 9:47 ` Yongbok Kim
2015-05-21 16:15 ` Richard Henderson
2015-05-20 15:12 ` [Qemu-devel] [PATCH v4 2/3] softmmu: Add probe_write() Yongbok Kim
2015-05-20 17:10 ` Richard Henderson
2015-05-20 15:12 ` [Qemu-devel] [PATCH v4 3/3] target-mips: Misaligned memory accesses for MSA Yongbok Kim
2015-05-20 17:25 ` Richard Henderson [this message]
2015-05-21 9:47 ` Yongbok Kim
2015-05-21 16:16 ` Richard Henderson
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=555CC394.5080501@twiddle.net \
--to=rth@twiddle.net \
--cc=afaerber@suse.de \
--cc=leon.alrae@imgtec.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=yongbok.kim@imgtec.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.