Add -mlzcnt.
authorKirill Yukhin <kirill.yukhin@intel.com>
Mon, 1 Aug 2011 13:47:31 +0000 (13:47 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Mon, 1 Aug 2011 13:47:31 +0000 (06:47 -0700)
commit5fcafa6051863dbabf1d9798ec45b83df942509d
tree35f575996429f663452714abea2458a0099073e1
parent4561baf7b73070dd11b2df4bff5480e61ee545be
Add -mlzcnt.

gcc/

2011-08-01  Kirill Yukhin  <kirill.yukhin@intel.com>

PR target/49547
* config.gcc (i[34567]86-*-*): Replace abmintrin.h with
lzcntintrin.h.
(x86_64-*-*): Likewise.
* config/i386/i386.opt (mlzcnt): New.
* config/i386/abmintrin.h: File removed.
(__lzcnt_u16, __lzcnt, __lzcnt_u64): Moved to ...
* config/i386/lzcntintrin.h: ... here. New file.
(__lzcnt): Rename to ...
(__lzcnt32): ... this.
* config/i386/bmiintrin.h (head): Update copyright year.
(__lzcnt_u16): Removed.
(__lzcnt_u32): Likewise.
(__lzcnt_u64): Likewise.
* config/i386/x86intrin.h: Include lzcntintrin.h when __LZCNT__
is defined, remove abmintrin.h.
* config/i386/cpuid.h (bit_LZCNT): New.
* config/i386/driver-i386.c (host_detect_local_cpu): Detect
LZCNT feature.
* config/i386/i386-c.c (ix86_target_macros_internal): Define
__LZCNT__ if needed.
* config/i386/i386.c (ix86_target_string): New option -mlzcnt.
(ix86_option_override_internal): Handle LZCNT option.
(ix86_valid_target_attribute_inner_p): Likewise.
(struct builtin_description bdesc_args) <IX86_BUILTIN_CLZS>: Update.
* config/i386/i386.h (TARGET_LZCNT): New.
(CLZ_DEFINED_VALUE_AT_ZERO): Update.
* config/i386/i386.md (clz<mode>2): Update insn constraint.
(clz<mode>2_lzcnt): Likewise.
* doc/invoke.texi: Mention -mlzcnt option.
* doc/extend.texi: Likewise.

gcc/testsuite/

2011-08-01  Kirill Yukhin  <kirill.yukhin@intel.com>

* gcc.target/i386/i386.exp (check_effective_target_lzcnt): New.
* gcc.target/i386/lzcnt-1.c: New test.
* gcc.target/i386/lzcnt-2.c: Likewise.
* gcc.target/i386/lzcnt-2a.c: Likewise.
* gcc.target/i386/lzcnt-3.c: Likewise.
* gcc.target/i386/lzcnt-4.c: Likewise.
* gcc.target/i386/lzcnt-4a.c: Likewise.
* gcc.target/i386/lzcnt-5.c: Likewise.
* gcc.target/i386/lzcnt-6.c: Likewise.
* gcc.target/i386/lzcnt-6a.c: Likewise.
* gcc.target/i386/lzcnt-check.h: Likewise.

* gcc.target/i386/sse-12.c (dg-compile): Add -mlzcnt.
* gcc.target/i386/sse-13.c: Likewise.
* gcc.target/i386/sse-14.c: Likewise.
* g++.dg/other/i386-2.C: Likewise.
* g++.dg/other/i386-3.C: Likewise.

From-SVN: r177034
32 files changed:
gcc/ChangeLog
gcc/config.gcc
gcc/config/i386/abmintrin.h [deleted file]
gcc/config/i386/bmiintrin.h
gcc/config/i386/cpuid.h
gcc/config/i386/driver-i386.c
gcc/config/i386/i386-c.c
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/i386.md
gcc/config/i386/i386.opt
gcc/config/i386/lzcntintrin.h [new file with mode: 0644]
gcc/config/i386/x86intrin.h
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/i386-2.C
gcc/testsuite/g++.dg/other/i386-3.C
gcc/testsuite/gcc.target/i386/i386.exp
gcc/testsuite/gcc.target/i386/lzcnt-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/lzcnt-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/lzcnt-2a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/lzcnt-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/lzcnt-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/lzcnt-4a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/lzcnt-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/lzcnt-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/lzcnt-6a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/lzcnt-check.h [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse-12.c
gcc/testsuite/gcc.target/i386/sse-13.c
gcc/testsuite/gcc.target/i386/sse-14.c