From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>,
qemu-devel@nongnu.org
Cc: smarkovic@wavecomp.com, riku.voipio@iki.fi,
richard.henderson@linaro.org, laurent@vivier.eu,
amarkovic@wavecomp.com, pjovanovic@wavecomp.com,
aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH v2 7/7] target/mips: Implement emulation of nanoMIPS EVA instructions
Date: Fri, 5 Oct 2018 19:27:15 +0200 [thread overview]
Message-ID: <a513edc7-f977-874d-0025-3b7067a33fa1@redhat.com> (raw)
In-Reply-To: <1538752793-6875-8-git-send-email-aleksandar.markovic@rt-rk.com>
Hi Aleksandar,
On 05/10/2018 17:19, Aleksandar Markovic wrote:
> From: Dimitrije Nikolic <dnikolic@wavecomp.com>
>
> Implement emulation of nanoMIPS EVA instructions. They are all
> part of P.LS.E0 instruction pool, or one of its subpools.
>
Shouldn't this be signed off by Dimitrije Nikolic too?
> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
> ---
> target/mips/translate.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 79 insertions(+)
>
> diff --git a/target/mips/translate.c b/target/mips/translate.c
> index b0b2f40..3adf31f 100644
> --- a/target/mips/translate.c
> +++ b/target/mips/translate.c
> @@ -1979,6 +1979,17 @@ static inline void check_nms(DisasContext *ctx)
> }
> }
>
> +/*
> + * This code generates a "reserved instruction" exception if the
> + * Config5 EVA bit is NOT set.
> + */
> +static inline void check_eva(DisasContext *ctx)
> +{
> + if (!unlikely(ctx->CP0_Config5 & (1 << CP0C5_EVA))) {
> + generate_exception_end(ctx, EXCP_RI);
> + }
> +}
> +
>
> /* Define small wrappers for gen_load_fpr* so that we have a uniform
> calling interface for 32 and 64-bit FPRs. No sense in changing
> @@ -20011,6 +20022,74 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx)
> break;
> }
> break;
> + case NM_P_LS_E0:
> + check_eva(ctx);
> + switch (extract32(ctx->opcode, 11, 4)) {
> + case NM_LBE:
> + gen_ld(ctx, OPC_LBE, rt, rs, s);
> + break;
> + case NM_SBE:
> + gen_st(ctx, OPC_SBE, rt, rs, s);
> + break;
> + case NM_LBUE:
> + gen_ld(ctx, OPC_LBUE, rt, rs, s);
> + break;
> + case NM_P_PREFE:
> + if (rt == 31) {
> + /* SYNCIE */
> + /* Break the TB to be able to sync copied instructions
> + immediately */
> + ctx->base.is_jmp = DISAS_STOP;
> + } else {
> + /* PREF */
> + /* Treat as NOP. */
> + }
> + break;
> + case NM_LHE:
> + gen_ld(ctx, OPC_LHE, rt, rs, s);
> + break;
> + case NM_SHE:
> + gen_st(ctx, OPC_SHE, rt, rs, s);
> + break;
> + case NM_LHUE:
> + gen_ld(ctx, OPC_LHUE, rt, rs, s);
> + break;
> + case NM_CACHEE:
> + /* Treat as no-op */
What about NMS core without caches? Shouldn't we use:
check_nms(ctx);
> + if (ctx->hflags & MIPS_HFLAG_ITC_CACHE) {
> + gen_cache_operation(ctx, rt, rs, s);
> + }
> + break;
> + case NM_LWE:
> + gen_ld(ctx, OPC_LWE, rt, rs, s);
> + break;
> + case NM_SWE:
> + gen_st(ctx, OPC_SWE, rt, rs, s);
> + break;
> + case NM_P_LLE:
> + switch (extract32(ctx->opcode, 2, 2)) {
> + case NM_LL:
> + gen_ld(ctx, OPC_LLE, rt, rs, s);
> + break;
> + case NM_LLWP:
> + default:
> + generate_exception_end(ctx, EXCP_RI);
> + break;
> + }
> + break;
> + case NM_P_SCE:
> + switch (extract32(ctx->opcode, 2, 2)) {
> + case NM_SC:
> + gen_st_cond(ctx, OPC_SCE, rt, rs, s);
> + break;
> + case NM_SCWP:
> + default:
> + generate_exception_end(ctx, EXCP_RI);
> + break;
> + }
> + break;
> + }
> + break;
> case NM_P_LS_WM:
> case NM_P_LS_UAWM:
> check_nms(ctx);
>
The rest of this patch is OK.
Regards,
Phil.
prev parent reply other threads:[~2018-10-05 17:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-05 15:19 [Qemu-devel] [PATCH v2 0/7] Misc MIPS fixes and improvements for October 2018 Aleksandar Markovic
2018-10-05 15:19 ` [Qemu-devel] [PATCH v2 1/7] elf: Fix PT_MIPS_XXX constants Aleksandar Markovic
2018-10-05 15:19 ` [Qemu-devel] [PATCH v2 2/7] elf: Add MIPS_ABI_FP_XXX constants Aleksandar Markovic
2018-10-05 15:19 ` [Qemu-devel] [PATCH v2 3/7] elf: Add Mips_elf_abiflags_v0 structure Aleksandar Markovic
2018-10-05 15:19 ` [Qemu-devel] [PATCH v2 4/7] target/mips: Add bit definitions for DSP R3 ASE Aleksandar Markovic
2018-10-08 14:03 ` Aleksandar Markovic
2018-10-05 15:19 ` [Qemu-devel] [PATCH v2 5/7] target/mips: Add availability control " Aleksandar Markovic
2018-10-08 14:05 ` Aleksandar Markovic
2018-10-05 15:19 ` [Qemu-devel] [PATCH v2 6/7] target/mips: Add opcodes for nanoMIPS EVA instructions Aleksandar Markovic
2018-10-05 17:16 ` Philippe Mathieu-Daudé
2018-10-08 14:07 ` Aleksandar Markovic
2018-10-05 15:19 ` [Qemu-devel] [PATCH v2 7/7] target/mips: Implement emulation of " Aleksandar Markovic
2018-10-05 17:27 ` Philippe Mathieu-Daudé [this message]
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=a513edc7-f977-874d-0025-3b7067a33fa1@redhat.com \
--to=philmd@redhat.com \
--cc=aleksandar.markovic@rt-rk.com \
--cc=amarkovic@wavecomp.com \
--cc=aurelien@aurel32.net \
--cc=laurent@vivier.eu \
--cc=pjovanovic@wavecomp.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=riku.voipio@iki.fi \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).