From: Paolo Bonzini <pbonzini@redhat.com>
To: Richard Henderson <rth@twiddle.net>, qemu-devel@nongnu.org
Cc: stefanha@redhat.com, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] exec: optimize phys_page_set_level
Date: Wed, 03 Jun 2015 09:03:48 +0200 [thread overview]
Message-ID: <556EA6D4.701@redhat.com> (raw)
In-Reply-To: <556E8300.1010108@twiddle.net>
On 03/06/2015 06:30, Richard Henderson wrote:
> On 05/21/2015 06:19 AM, Paolo Bonzini wrote:
>> memcpy is faster than struct assignment, which copies each bitfield
>> individually. Arguably a compiler bug, but memcpy is super-special
>> cased anyway so what could go wrong?
>
> The compiler has the option of doing the copy either way. Any way to
> actually show that the small memcpy is faster? That's one of those
> things where I'm sure there's a cost calculation that said per member
> was better.
Because the struct size is 32 bits, it's a no brainer that full copy is
faster. However, SRA gets in the way, and causes the struct assignment
to be compiled as two separate bitfield assignment. Later GCC passes
don't have the means to merge them again. I filed
https://gcc.gnu.org/PR66391 about this and CCed Martin Jambor.
Paolo
next prev parent reply other threads:[~2015-06-03 7:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-21 13:19 [Qemu-devel] [PATCH] exec: optimize phys_page_set_level Paolo Bonzini
2015-05-22 8:01 ` Stefan Hajnoczi
2015-06-03 4:30 ` Richard Henderson
2015-06-03 7:03 ` Paolo Bonzini [this message]
2015-06-03 16:14 ` Michael S. Tsirkin
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=556EA6D4.701@redhat.com \
--to=pbonzini@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanha@redhat.com \
/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).