From: Richard Henderson <rth@twiddle.net>
To: Pranith Kumar <bobby.prani@gmail.com>, alex.bennee@linaro.org
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH 1/3] tcg/aarch64: Introduce and use jump to register
Date: Thu, 8 Jun 2017 09:50:09 -0700 [thread overview]
Message-ID: <dc8ff867-6d7b-136f-dae9-a5fe11ac98c2@twiddle.net> (raw)
In-Reply-To: <20170607225212.23714-2-bobby.prani@gmail.com>
On 06/07/2017 03:52 PM, Pranith Kumar wrote:
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> ---
> tcg/aarch64/tcg-target.inc.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c
> index 1fa3bccc89..ab0a8caa03 100644
> --- a/tcg/aarch64/tcg-target.inc.c
> +++ b/tcg/aarch64/tcg-target.inc.c
> @@ -819,6 +819,12 @@ static inline void tcg_out_goto(TCGContext *s, tcg_insn_unit *target)
> tcg_out_insn(s, 3206, B, offset);
> }
>
> +static inline void tcg_out_goto_register(TCGContext *s, intptr_t target)
> +{
> + tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_TMP, target);
> + tcg_out_insn(s, 3207, BR, TCG_REG_TMP);
> +}
> +
> static inline void tcg_out_goto_noaddr(TCGContext *s)
> {
> /* We pay attention here to not modify the branch target by reading from
> @@ -1364,10 +1370,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
> case INDEX_op_exit_tb:
> /* Reuse the zeroing that exists for goto_ptr. */
> if (a0 == 0) {
> - tcg_out_goto(s, s->code_gen_epilogue);
> + tcg_out_goto_register(s, (intptr_t)(s->code_gen_epilogue));
This pessimises the first 128MB of the buffer by not using a direct branch when
it fits. I think you should call the new function tcg_out_goto_long, and
structure the function like tcg_out_call.
r~
next prev parent reply other threads:[~2017-06-08 16:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-07 22:52 [Qemu-devel] [RFC PATCH 0/3] Remove code buffer size limitation on aarch64 hosts Pranith Kumar
2017-06-07 22:52 ` [Qemu-devel] [RFC PATCH 1/3] tcg/aarch64: Introduce and use jump to register Pranith Kumar
2017-06-08 16:50 ` Richard Henderson [this message]
2017-06-07 22:52 ` [Qemu-devel] [RFC PATCH 2/3] tcg/aarch64: Introdue LDR (literal) for aarch64 Pranith Kumar
2017-06-07 22:52 ` [Qemu-devel] [RFC PATCH 3/3] tcg/aarch64: Remove code buffer size limitation Pranith Kumar
2017-06-08 16:58 ` 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=dc8ff867-6d7b-136f-dae9-a5fe11ac98c2@twiddle.net \
--to=rth@twiddle.net \
--cc=alex.bennee@linaro.org \
--cc=bobby.prani@gmail.com \
--cc=qemu-devel@nongnu.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).