qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Max Filippov <jcmvbkbc@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] target/xtensa: rework zero overhead loops implementation
Date: Sat, 12 Jan 2019 09:09:01 +1100	[thread overview]
Message-ID: <2064503c-ed12-de29-59a9-46fa24d22f60@linaro.org> (raw)
In-Reply-To: <20190111220131.27153-1-jcmvbkbc@gmail.com>

On 1/12/19 9:01 AM, Max Filippov wrote:
> Don't invalidate TB with the end of zero overhead loop when LBEG or LEND
> change. Instead encode the distance from the start of the page where the
> TB starts to the LEND in the TB cs_base and generate loopback code when
> the next PC matches encoded LEND. Distance to a destination within the
> same page and up to a maximum instruction length into the next page is
> encoded literally, otherwise it's zero. The distance from LEND to LBEG
> is also encoded in the cs_base: it's encoded literally when less than
> 256 or as 0 otherwise. This allows for TB chaining for the loopback
> branch at the end of a loop for the most common loop sizes.
> 
> With this change the resulting emulation speed is about 10% higher in
> softmmu mode on uClibc-ng and LTP tests. Emulation speed in linux
> user mode is a few percent lower because there's no direct TB chaining
> between different memory pages. Testing with lower limit on direct TB
> chainig range shows gradual slowdown to ~15% for the block size of 64
> bytes and ~50% for the block size of 32 bytes.
> 
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


> +        /*
> +         * 0 in the csbase_lend field means that there may not be a loopback
> +         * for any instruction that starts inside this page. Any other value
> +         * means that an instruction that ends at this offset from the page
> +         * start may loop back.

Nit: s/may/will/g

Using "may" makes it seem like we may have missed a case that should have
looped back.


r~

  reply	other threads:[~2019-01-11 22:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11 22:01 [Qemu-devel] [PATCH v2] target/xtensa: rework zero overhead loops implementation Max Filippov
2019-01-11 22:09 ` Richard Henderson [this message]
2019-01-11 22:14   ` Max Filippov
2019-01-11 22:17     ` Richard Henderson
2019-01-11 22:23       ` Max Filippov
2019-01-11 22:27         ` Max Filippov
2019-01-11 22:44           ` 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=2064503c-ed12-de29-59a9-46fa24d22f60@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=jcmvbkbc@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).