From: Thomas Huth <thuth@redhat.com>
To: David Hildenbrand <david@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, Cornelia Huck <cohuck@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v1 4/7] s390x/tcg: Factor out vec_full_reg_offset()
Date: Mon, 25 Feb 2019 13:32:03 +0100 [thread overview]
Message-ID: <edd983b7-d93c-2315-9e3b-f7531b0fe427@redhat.com> (raw)
In-Reply-To: <20190225115552.7534-5-david@redhat.com>
On 25/02/2019 12.55, David Hildenbrand wrote:
> We'll use that a lot along with gvec helpers, to calculate the start
> address of a vector.
>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
> target/s390x/translate.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/target/s390x/translate.c b/target/s390x/translate.c
> index 916508b567..f8c285a685 100644
> --- a/target/s390x/translate.c
> +++ b/target/s390x/translate.c
> @@ -145,12 +145,17 @@ void s390x_translate_init(void)
> }
> }
>
> +static inline int vec_full_reg_offset(uint8_t reg)
> +{
> + g_assert(reg < 32);
> + return offsetof(CPUS390XState, vregs[reg][0].d);
> +}
> +
> static inline int vec_reg_offset(uint8_t reg, uint8_t enr, TCGMemOp es)
> {
> const uint8_t bytes = 1 << es;
> int offs = enr * bytes;
>
> - g_assert(reg < 32);
> /*
> * vregs[n][0] is the lowest 8 byte and vregs[n][1] the highest 8 byte
> * of the 16 byte vector, on both, little and big endian systems.
> @@ -177,7 +182,7 @@ static inline int vec_reg_offset(uint8_t reg, uint8_t enr, TCGMemOp es)
> #ifndef HOST_WORDS_BIGENDIAN
> offs ^= (8 - bytes);
> #endif
> - return offs + offsetof(CPUS390XState, vregs[reg][0].d);
> + return offs + vec_full_reg_offset(reg);
> }
>
> static inline int freg64_offset(uint8_t reg)
>
Reviewed-by: Thomas Huth <thuth@redhat.com>
next prev parent reply other threads:[~2019-02-25 12:32 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-25 11:55 [Qemu-devel] [PATCH v1 0/7] s390x/tcg: Cleanups and refactorings for Vector David Hildenbrand
2019-02-25 11:55 ` [Qemu-devel] [PATCH v1 1/7] s390x/tcg: RXE has an optional M3 field David Hildenbrand
2019-02-25 12:18 ` Thomas Huth
2019-02-25 15:46 ` Richard Henderson
2019-02-25 11:55 ` [Qemu-devel] [PATCH v1 2/7] s390x/tcg: Simplify disassembler operands initialization David Hildenbrand
2019-02-25 12:20 ` Thomas Huth
2019-02-25 12:21 ` Cornelia Huck
2019-02-25 13:32 ` David Hildenbrand
2019-02-25 15:47 ` Richard Henderson
2019-02-25 11:55 ` [Qemu-devel] [PATCH v1 3/7] s390x/tcg: Clarify terminology in vec_reg_offset() David Hildenbrand
2019-02-25 12:30 ` Thomas Huth
2019-02-25 13:33 ` David Hildenbrand
2019-02-25 15:47 ` Richard Henderson
2019-02-25 11:55 ` [Qemu-devel] [PATCH v1 4/7] s390x/tcg: Factor out vec_full_reg_offset() David Hildenbrand
2019-02-25 12:32 ` Thomas Huth [this message]
2019-02-25 11:55 ` [Qemu-devel] [PATCH v1 5/7] s390x/tcg: Factor out gen_addi_and_wrap_i64() from get_address() David Hildenbrand
2019-02-25 15:53 ` Richard Henderson
2019-02-25 16:08 ` David Hildenbrand
2019-02-25 11:55 ` [Qemu-devel] [PATCH v1 6/7] s390x/tcg: Implement LOAD LENGTHENED short HFP to long HFP David Hildenbrand
2019-02-25 15:59 ` Richard Henderson
2019-02-25 11:55 ` [Qemu-devel] [PATCH v1 7/7] s390x/tcg: Implement LOAD COUNT TO BLOCK BOUNDARY David Hildenbrand
2019-02-25 16:14 ` Richard Henderson
2019-02-25 16:17 ` David Hildenbrand
2019-02-25 16:40 ` Richard Henderson
2019-02-25 19:55 ` David Hildenbrand
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=edd983b7-d93c-2315-9e3b-f7531b0fe427@redhat.com \
--to=thuth@redhat.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rth@twiddle.net \
/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).