This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH PR62011]
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Yuri Rumyantsev <ysrumyan at gmail dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Uros Bizjak <ubizjak at gmail dot com>
- Date: Fri, 15 Aug 2014 13:54:40 +0200
- Subject: Re: [PATCH PR62011]
- Authentication-results: sourceware.org; auth=none
- References: <CAEoMCqRQgLeT9EpwxmX99wi=Fzc3CN2ZE4dQGATTVd8xmV1nNA at mail dot gmail dot com> <CAMe9rOqbe3Pjv=T5rid_UQje+vQEXXR8GjLcEWx+Yr7c3KCQAg at mail dot gmail dot com> <CAEoMCqT8LMm27N8tEiY3Q=W1b2g6s5SR9KT4P1MhsV8q3Mm6MA at mail dot gmail dot com> <CAEoMCqTWviiyX=LcL-pMCUhniqazcmtHpb47LCjL8vadHxrFaA at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Aug 15, 2014 at 03:45:33PM +0400, Yuri Rumyantsev wrote:
> gcc/ChangeLog
> 2014-08-15 Yuri Rumyantsev <ysrumyan@gmail.com>
>
> PR target/62011
> * config/i386/i386-protos.h (ix86_avoid_false_dep_for_bm): New function
> prototype.
> * config/i386/i386.c (ix86_avoid_false_dep_for_bm): New function.
> * config/i386/i386.h (TARGET_AVOID_FALSE_DEP_FOR_BM) New macros.
> * config/i386/i386.md (ctz<mode>2, clz<mode>2_lzcnt, popcount<mode>2,
> *popcount<mode>2_cmp, *popcountsi2_cmp_zext): Output zeroing
> destination register for unary bit-manipulation instructions
> if required.
> * config/i386/x86-tune.def (X86_TUNE_AVOID_FALSE_DEP_FOR_BM): New.
--- config/i386/i386.md (revision 213842)
+++ config/i386/i386.md (working copy)
@@ -12111,7 +12111,13 @@
""
{
if (TARGET_BMI)
- return "tzcnt{<imodesuffix>}\t{%1, %0|%0, %1}";
+ {
+ if (ix86_avoid_false_dep_for_bm (insn, operands))
+ return "xor{<imodesuffix>}\t%0, %0\n\t"
+ "tzcnt{<imodesuffix>}\t{%1, %0|%0, %1}";
+ else
+ return "tzcnt{<imodesuffix>}\t{%1, %0|%0, %1}";
+ }
else if (optimize_function_for_size_p (cfun))
;
else if (TARGET_GENERIC)
etc., this will make lenght attribute incorrect though.
Jakub