From: Andi Kleen <andi@firstfloor.org>
To: Denys Vlasenko <dvlasenk@redhat.com>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andy Lutomirski <luto@amacapital.net>,
Oleg Nesterov <oleg@redhat.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Will Drewry <wad@chromium.org>, Kees Cook <keescook@chromium.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: clean up unnecessarily wide TEST insns
Date: Fri, 06 Mar 2015 14:24:17 -0800 [thread overview]
Message-ID: <87h9txahny.fsf@tassilo.jf.intel.com> (raw)
In-Reply-To: <1425675332-31576-1-git-send-email-dvlasenk@redhat.com> (Denys Vlasenko's message of "Fri, 6 Mar 2015 21:55:32 +0100")
Denys Vlasenko <dvlasenk@redhat.com> writes:
> By the nature of TEST operation, it is often possible
> to test a narrower part of the operand:
> "testl $3, mem" -> "testb $3, mem",
> "testq $3, %rcx" -> "testb $3, %cl"
> This results in shorter insns, because TEST insn has no
> sign-entending byte-immediate forms unlike other ALU ops.
It also results in expensive LCP stalls. Please don't do it.
If you feel the need to change instructions around like this read
the optimization manuals first.
-Andi
--
ak@linux.intel.com -- Speaking for myself only
next prev parent reply other threads:[~2015-03-06 22:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 20:55 [PATCH] x86: clean up unnecessarily wide TEST insns Denys Vlasenko
2015-03-06 21:05 ` Andy Lutomirski
2015-03-07 10:13 ` Ingo Molnar
2015-03-06 22:24 ` Andi Kleen [this message]
2015-03-06 22:33 ` Andy Lutomirski
2015-03-06 22:37 ` Denys Vlasenko
2015-03-06 22:54 ` Linus Torvalds
2015-03-07 16:43 ` [tip:x86/asm] x86/asm: Optimize unnecessarily wide TEST instructions tip-bot for Denys Vlasenko
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=87h9txahny.fsf@tassilo.jf.intel.com \
--to=andi@firstfloor.org \
--cc=bp@alien8.de \
--cc=dvlasenk@redhat.com \
--cc=fweisbec@gmail.com \
--cc=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
--cc=wad@chromium.org \
--cc=x86@kernel.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.