From: Richard Henderson <rth@twiddle.net>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH 5/5] tcg/i386: Use SHLX/SHRX/SARX instructions
Date: Mon, 17 Feb 2014 10:01:38 -0600 [thread overview]
Message-ID: <53023262.6030402@twiddle.net> (raw)
In-Reply-To: <5300C968.9040609@redhat.com>
On 02/16/2014 08:21 AM, Paolo Bonzini wrote:
> Il 31/01/2014 15:43, Richard Henderson ha scritto:
>> + gen_shift_maybe_vex:
>> + if (have_bmi2 && !const_args[2]) {
>> + tcg_out_vex_modrm(s, vexop + rexw, args[0], args[2], args[1]);
>> + break;
>> + }
>> + /* FALLTHRU */
>
> What if args[2] happens to be ECX?
I ran some measurements and as I expected this basically never happens. For
64-bit, I never saw it occur. For 32-bit, 1/800 of all shifts used ecx.
For 64-bit, the use of shlx et al is always a size win. The mov and shift,
including their rex prefixes, are 3 bytes each, while the shlx is 5 byes.
For 32-bit, things are more complicated. The mov and shift are 2 bytes each,
so the use of shlx is by itself a 1 byte size penalty. Except that sometimes
the avoidance of the mov results in fewer spills, and thus fewer bytes overall.
So overall I see the barest fraction (< 0.01%) size decrease across all TBs.
r~
next prev parent reply other threads:[~2014-02-17 22:48 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 14:43 [Qemu-devel] [PATCH 0/5] tcg/i386 support for bmi Richard Henderson
2014-01-31 14:43 ` [Qemu-devel] [PATCH 1/5] disas/i386: Disassemble ANDN/SHLX/SHRX/SHAX Richard Henderson
2014-02-16 18:12 ` Aurelien Jarno
2014-01-31 14:43 ` [Qemu-devel] [PATCH 2/5] tcg/i386: Move TCG_CT_CONST_* to tcg-target.c Richard Henderson
2014-02-16 18:12 ` Aurelien Jarno
2014-01-31 14:43 ` [Qemu-devel] [PATCH 3/5] tcg/i386: Add tcg_out_vex_modrm Richard Henderson
2014-02-16 18:12 ` Aurelien Jarno
2014-01-31 14:43 ` [Qemu-devel] [PATCH 4/5] tcg/i386: Use ANDN instruction Richard Henderson
2014-02-16 18:12 ` Aurelien Jarno
2014-02-17 16:18 ` Richard Henderson
2014-02-20 16:25 ` Peter Maydell
2014-02-20 16:42 ` Peter Maydell
2014-02-20 16:43 ` Richard Henderson
2014-02-20 17:38 ` Peter Maydell
2014-01-31 14:43 ` [Qemu-devel] [PATCH 5/5] tcg/i386: Use SHLX/SHRX/SARX instructions Richard Henderson
2014-02-16 14:21 ` Paolo Bonzini
2014-02-16 17:57 ` Richard Henderson
2014-02-17 16:01 ` Richard Henderson [this message]
2014-02-16 18:12 ` Aurelien Jarno
2014-02-14 21:44 ` [Qemu-devel] [PATCH 0/5] tcg/i386 support for bmi Richard Henderson
2014-02-16 14:22 ` 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=53023262.6030402@twiddle.net \
--to=rth@twiddle.net \
--cc=aurelien@aurel32.net \
--cc=pbonzini@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.