diff options
author | Victoria Stepanyan <victoria.stepanyan@amd.com> | 2015-12-06 17:02:48 +0000 |
---|---|---|
committer | Venkataramanan Kumar <vekumar@gcc.gnu.org> | 2015-12-06 17:02:48 +0000 |
commit | 62e56a0d652ce83ae3d220cc4a01de46674188f1 (patch) | |
tree | caf97ab569ab5baf08a9753bd71ed1d4c81deee5 /gcc/config/i386/clzerointrin.h | |
parent | 2097a8906f26415d7ad36f485ad7841ed5142fba (diff) | |
download | gcc-62e56a0d652ce83ae3d220cc4a01de46674188f1.tar.gz |
support for AMD clzero isa.
gcc/ChangeLog
2015-12-06 Victoria Stepanyan <victoria.stepanyan@amd.com>
* common/config/i386/i386-common.c
(OPTION_MASK_ISA_CLZERO_SET): New.
(ix86_handle_option): Handle clzero.
* config.gcc (i[34567]86-*-*): Add clzerointrin.h,
(x86_64-*-*): Likewise.
* config/i386/clzerointrin.h: New header.
* config/i386/cpuid.h (bit_CLZERO): Define.
* config/i386/driver-i386.c (host_detect_local_cpu): Detect
CLZERO support.
* config/i386/i386.opt (clzero): New.
* config/i386/i386-c.c: Define __CLZERO__ if needed.
* config/i386/i386.c (ix86_target_string): Define -mclzero option.
(PTA_CLZERO): New.
(ix86_option_override_internal): Handle new option.
(processor_alias_table): Added PTA_CLZERO.
(ix86_valid_target_attribute_inner_p): Add OPT_mclzero.
(ix86_builtins): Add IX86_BUILTIN_CLZERO, IX86_BUILTIN_CLZERO.
(ix86_expand_builtin): Handle IX86_BUILTIN_CLZERO and
IX86_BUILTIN_CLZERO built-ins.
* config/i386/i386.h (TARGET_CLZERO): New.
* config/i386/i386.md (unspecv): Add UNSPEC_CLZERO.
(clzero): New pattern.
(clzero_<mode>): New pattern.
* config/i386/x86intrin.h: Include clzerointrin.h.
* doc/extend.texi: Document clzero builtins.
* doc/invoke.texi: Document -mclzero option.
gcc/testsuite/ChangeLog
2015-12-06 Victoria Stepanyan <victoria.stepanyan@amd.com>
* gcc.target/i386/clzero.c: New.
* gcc.target/i386/sse-12.c: Add -mclzero.
* gcc.target/i386/sse-13.c: Ditto.
* gcc.target/i386/sse-14.c: Ditto.
* gcc.target/i386/sse-22.c: Ditto.
* gcc.target/i386/sse-23.c: Ditto.
* g++.dg/other/i386-2.C: Ditto.
* g++.dg/other/i386-3.C: Ditto.
From-SVN: r231340
Diffstat (limited to 'gcc/config/i386/clzerointrin.h')
-rw-r--r-- | gcc/config/i386/clzerointrin.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc/config/i386/clzerointrin.h b/gcc/config/i386/clzerointrin.h new file mode 100644 index 00000000000..696585b6d88 --- /dev/null +++ b/gcc/config/i386/clzerointrin.h @@ -0,0 +1,44 @@ +/* Copyright (C) 2012-2015 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _CLZEROINTRIN_H_INCLUDED +#define _CLZEROINTRIN_H_INCLUDED + +#ifndef __CLZERO__ +#pragma GCC push_options +#pragma GCC target("clzero") +#define __DISABLE_CLZERO__ +#endif /* __CLZERO__ */ + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_clzero (void * __I) +{ + __builtin_ia32_clzero (__I); +} + +#ifdef __DISABLE_CLZERO__ +#undef __DISABLE_CLZERO__ +#pragma GCC pop_options +#endif /* __DISABLE_CLZERO__ */ + +#endif /* _CLZEROINTRIN_H_INCLUDED */ |