From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH 1/2] target/arm: Export aarch64_sve_zcr_get_valid_len
Date: Fri, 16 Jul 2021 09:53:27 +0100 [thread overview]
Message-ID: <CAFEAcA9B8Pb6cjj3ArkrzqfCVtdY_fB4jSCK3kUGeAGQBVJw2g@mail.gmail.com> (raw)
In-Reply-To: <20210714180635.1648966-2-richard.henderson@linaro.org>
On Wed, 14 Jul 2021 at 19:06, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Rename from sve_zcr_get_valid_len and make accessible
> from outside of helper.c.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/arm/cpu.h | 2 ++
> target/arm/helper.c | 8 +++++---
> 2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index be9a4dceae..52e99344c5 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -1060,6 +1060,8 @@ int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
> int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
> int cpuid, void *opaque);
>
> +uint32_t aarch64_sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len);
We only need this in cpu.c, I think, so I would favour putting it
in internals.h. A brief comment defining its purpose would also be good.
> +
> #ifdef TARGET_AARCH64
> int aarch64_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
> int aarch64_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
> diff --git a/target/arm/helper.c b/target/arm/helper.c
> index 910ace4274..a49067c115 100644
> --- a/target/arm/helper.c
> +++ b/target/arm/helper.c
> @@ -6454,11 +6454,13 @@ int sve_exception_el(CPUARMState *env, int el)
> return 0;
> }
>
> -static uint32_t sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len)
> +uint32_t aarch64_sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len)
> {
> uint32_t end_len;
>
> - end_len = start_len &= 0xf;
> + start_len = MIN(start_len, ARM_MAX_VQ - 1);
> + end_len = start_len;
> +
This seems to also be making a functional change? That should be
a separate patch.
> if (!test_bit(start_len, cpu->sve_vq_map)) {
> end_len = find_last_bit(cpu->sve_vq_map, start_len);
> assert(end_len < start_len);
> @@ -6484,7 +6486,7 @@ uint32_t sve_zcr_len_for_el(CPUARMState *env, int el)
> zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[3]);
> }
>
> - return sve_zcr_get_valid_len(cpu, zcr_len);
> + return aarch64_sve_zcr_get_valid_len(cpu, zcr_len);
> }
thanks
-- PMM
next prev parent reply other threads:[~2021-07-16 8:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-14 18:06 [PATCH 0/2] target/arm: Add sve-default-vector-length cpu property Richard Henderson
2021-07-14 18:06 ` [PATCH 1/2] target/arm: Export aarch64_sve_zcr_get_valid_len Richard Henderson
2021-07-16 8:53 ` Peter Maydell [this message]
2021-07-14 18:06 ` [PATCH 2/2] target/arm: Add sve-default-vector-length cpu property Richard Henderson
2021-07-16 9:14 ` Peter Maydell
2021-07-23 18:47 ` 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=CAFEAcA9B8Pb6cjj3ArkrzqfCVtdY_fB4jSCK3kUGeAGQBVJw2g@mail.gmail.com \
--to=peter.maydell@linaro.org \
--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 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).