qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org, peter.maydell@linaro.org,
	pbonzini@redhat.com, "Alex Bennée" <alex.bennee@linaro.org>
Subject: [Qemu-devel] [RFC PATCH 0/6] Convert softmmu-template into normal code
Date: Fri, 20 Apr 2018 16:50:39 +0100	[thread overview]
Message-ID: <20180420155045.18862-1-alex.bennee@linaro.org> (raw)

Hi,

This is very much a Friday RFC patch but was born out of a chat I had
with Richard at Connect about our experience in the re-factoring of
softfloat.

The basic premise is we shouldn't need to jump through macro/glue
abuse for stuff a decent compiler should be able to dead code away at
compile time. Instead we can write common functions and use
__flatten__ to force the compiler to evaluate the result of merging
the inlined code as one complete blob. So far I haven't been able to
measure any difference in performance on my system compile benchmark.

Why go through all of this hassle? Some justifications:

  - no more "where is helper_le_stw_mmu defined?"
  - easier debugging in gdb
  - no duplicate code for be/le cases
  - more accessible code

I think there is also scope for more re-factoring and clean-up in the
code generally. I considered looking at the atomic and ldst templates
as well but decided to see what reaction the softmmu conversion got
first.

So far this has had very light testing for aarch64 guests on x86_64
hosts but it seems stable enough.

Any questions/thoughts/comments?

Alex Bennée (6):
  accel/tcg: export some cputlb functions
  accel/tcg: new softmmu.c with DATA_SIZE=1
  accel/tcg: add DATA_SIZE = 2 to softmmu
  accel/tcg: create load_helper
  accel/tcg: create store_helper
  accel/tcg: convert 4/8 byte access and remove softmmu_template

 accel/tcg/Makefile.objs      |   1 +
 accel/tcg/cputlb.c           |  61 +----
 accel/tcg/cputlb.h           |  20 ++
 accel/tcg/softmmu.c          | 497 +++++++++++++++++++++++++++++++++++
 accel/tcg/softmmu_template.h | 435 ------------------------------
 5 files changed, 528 insertions(+), 486 deletions(-)
 create mode 100644 accel/tcg/cputlb.h
 create mode 100644 accel/tcg/softmmu.c
 delete mode 100644 accel/tcg/softmmu_template.h

-- 
2.17.0

             reply	other threads:[~2018-04-20 15:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 15:50 Alex Bennée [this message]
2018-04-20 15:50 ` [Qemu-devel] [RFC PATCH 1/6] accel/tcg: export some cputlb functions Alex Bennée
2018-04-20 15:50 ` [Qemu-devel] [RFC PATCH 2/6] accel/tcg: new softmmu.c with DATA_SIZE=1 Alex Bennée
2018-04-20 15:50 ` [Qemu-devel] [RFC PATCH 3/6] accel/tcg: add DATA_SIZE = 2 to softmmu Alex Bennée
2018-04-20 15:50 ` [Qemu-devel] [RFC PATCH 4/6] accel/tcg: create load_helper Alex Bennée
2018-04-20 15:50 ` [Qemu-devel] [RFC PATCH 5/6] accel/tcg: create store_helper Alex Bennée
2018-04-20 15:50 ` [Qemu-devel] [RFC PATCH 6/6] accel/tcg: convert 4/8 byte access and remove softmmu_template Alex Bennée
2018-04-20 21:36   ` Richard Henderson
2018-04-20 16:01 ` [Qemu-devel] [RFC PATCH 0/6] Convert softmmu-template into normal code no-reply
2018-04-20 16:05 ` no-reply
2018-04-20 16:16 ` Paolo Bonzini
2018-04-20 16:22 ` Peter Maydell
2018-04-20 16:26 ` no-reply
2018-04-20 18:35 ` Emilio G. Cota
2018-04-20 18:43   ` Alex Bennée
2018-04-20 19:11   ` Philippe Mathieu-Daudé
2018-04-20 20:02     ` Emilio G. Cota
2018-04-20 19:17   ` Alex Bennée
2018-04-23 10:35   ` Paolo Bonzini

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=20180420155045.18862-1-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=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).