From: Richard Henderson <richard.henderson@linaro.org>
To: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>,
qemu-devel@nongnu.org
Cc: philippe.mathieu.daude@gmail.com, aurelien@aurel32.net,
amarkovic@wavecomp.com, smarkovic@wavecomp.com,
pjovanovic@wavecomp.com, pburton@wavecomp.com
Subject: Re: [Qemu-devel] [PATCH v4 6/8] target/mips: Amend CP0 WatchHi register implementation
Date: Fri, 6 Jul 2018 06:40:09 -0700 [thread overview]
Message-ID: <04dc592b-90e5-46be-7ce9-1447642234a0@linaro.org> (raw)
In-Reply-To: <1530877732-26557-7-git-send-email-aleksandar.markovic@rt-rk.com>
On 07/06/2018 04:48 AM, Aleksandar Markovic wrote:
> +++ b/target/mips/op_helper.c
> @@ -893,7 +893,12 @@ target_ulong helper_mfc0_watchlo(CPUMIPSState *env, uint32_t sel)
>
> target_ulong helper_mfc0_watchhi(CPUMIPSState *env, uint32_t sel)
> {
> - return env->CP0_WatchHi[sel];
> + return (int32_t) env->CP0_WatchHi[sel];
> +}
> +
> +target_ulong helper_mfhc0_watchhi(CPUMIPSState *env, uint32_t sel)
> +{
> + return env->CP0_WatchHi[sel] >> 32;
> }
Did you in fact want the high-part sign-extended as well?
It might be more obvious to write
return sextract64(env->CP0_WatchHi[sel], 32, 32);
in that case.
> +void helper_mthc0_watchhi(CPUMIPSState *env, target_ulong arg1, uint32_t sel)
> +{
> + env->CP0_WatchHi[sel] = ((uint64_t) (arg1) << 32) |
> + (env->CP0_WatchHi[sel] & 0x00000000ffffffffULL);
Cleaner as
env->CP0_WatchHi[sel] = deposit64(env->CP0_WatchHi[sel], 32, 32, arg1);
For future cleanup, there is nothing in this (or several other) that requires
writing helper code. This could just as easily be expanded inline with one
single load or store operation.
r~
next prev parent reply other threads:[~2018-07-06 13:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-06 11:48 [Qemu-devel] [PATCH v4 0/8] Maintenance and misc fixes and improvements Aleksandar Markovic
2018-07-06 11:48 ` [Qemu-devel] [PATCH v4 1/8] target/mips: Update maintainer's email addresses Aleksandar Markovic
2018-07-06 11:48 ` [Qemu-devel] [PATCH v4 2/8] target/mips: Workaround for checkpatch.pl hanging on msa_helper.c Aleksandar Markovic
2018-07-06 15:38 ` Aleksandar Markovic
2018-07-06 16:52 ` Philippe Mathieu-Daudé
2018-07-06 17:11 ` Aleksandar Markovic
2018-07-06 11:48 ` [Qemu-devel] [PATCH v4 3/8] target/mips: Update some CP0 registers bit definitions Aleksandar Markovic
2018-07-06 11:48 ` [Qemu-devel] [PATCH v4 4/8] target/mips: Avoid case statements formulated by ranges Aleksandar Markovic
2018-07-06 11:48 ` [Qemu-devel] [PATCH v4 5/8] target/mips: Add CP0 BadInstrX register Aleksandar Markovic
2018-07-06 16:54 ` Philippe Mathieu-Daudé
2018-07-06 11:48 ` [Qemu-devel] [PATCH v4 6/8] target/mips: Amend CP0 WatchHi register implementation Aleksandar Markovic
2018-07-06 13:40 ` Richard Henderson [this message]
2018-07-06 15:20 ` Aleksandar Markovic
2018-07-06 11:48 ` [Qemu-devel] [PATCH v4 7/8] target/mips: Don't update BadVAddr register in Debug Mode Aleksandar Markovic
2018-07-06 11:48 ` [Qemu-devel] [PATCH v4 8/8] target/mips: Check ELPA flag only in some cases of MFHC0 and MTHC0 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=04dc592b-90e5-46be-7ce9-1447642234a0@linaro.org \
--to=richard.henderson@linaro.org \
--cc=aleksandar.markovic@rt-rk.com \
--cc=amarkovic@wavecomp.com \
--cc=aurelien@aurel32.net \
--cc=pburton@wavecomp.com \
--cc=philippe.mathieu.daude@gmail.com \
--cc=pjovanovic@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 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).