summaryrefslogtreecommitdiff
path: root/gcc/config/i386/fxsrintrin.h
diff options
context:
space:
mode:
authorkyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-26 09:45:46 +0000
committerkyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-26 09:45:46 +0000
commit32eca732897e9d19bf26f1283582ee3ff120ffed (patch)
tree1b96719a7b5555bb3bf9215deb11b80b13b827c0 /gcc/config/i386/fxsrintrin.h
parentf8a22db12792095b65e73ef9c6c46f75ca2272f0 (diff)
downloadgcc-32eca732897e9d19bf26f1283582ee3ff120ffed.tar.gz
ChangeLog/
* gcc/common/config/i386/i386-common.c (OPTION_MASK_ISA_FXSR_SET): New. (OPTION_MASK_ISA_XSAVE_SET): Likewise. (OPTION_MASK_ISA_XSAVEOPT_SET): Likewise. (ix86_handle_option): Handle mfxsr, mxsave, mxsaveopt options. * gcc/config.gcc (i[34567]86-*-*): Add fxsrintrin.h, xsaveintrin.h, xsaveoptintrin.h. (x86_64-*-*): Likewise. * config/i386/fxsrintrin.h: New header. * config/i386/xsaveintrin.h: Likewise. * config/i386/xsaveoptintrin.h: Likewise. * gcc/config/i386/driver-i386.c (host_detect_local_cpu): Detect FXSR/XSAVE/XSAVEOPT support. * gcc/config/i386/i386-builtin-types.def (VOID_FTYPE_PVOID_INT64): New function type. * gcc/config/i386/i386-c.c: Define __FXSR__, __XSAVE__ and __XSAVEOPT__ if needed. * gcc/config/i386/i386.c (ix86_target_string): Define -mfxsr, -mxsave and -mxsaveopt options. (PTA_FXSR): New. (PTA_XSAVE): Likewise. (PTA_XSAVEOPT): Likewise. (ix86_option_override_internal): Handle new option. (processor_alias_table): Added PTA_FXSR, PTA_XSAVE, PTA_XSAVEOPT. (ix86_valid_target_attribute_inner_p): Add OPT_mfxsr, OPT_mxsave, OPT_mxsaveopt. (ix86_builtins): Add IX86_BUILTIN_FXSAVE, IX86_BUILTIN_FXRSTOR, IX86_BUILTIN_FXSAVE64, IX86_BUILTIN_XSAVE, IX86_BUILTIN_XSAVE64, IX86_BUILTIN_XRSTOR, IX86_BUILTIN_XRSTOR64, IX86_BUILTIN_XSAVEOPT, IX86_BUILTIN_XSAVEOPT64. (ix86_expand_builtin): Handle these built-ins. * gcc/config/i386/i386.h (TARGET_FXSR): New. (TARGET_XSAVE): Likewise. (TARGET_XSAVEOPT): Likewise. * gcc/config/i386/i386.md (ANY_XSAVE): New int iterator. (ANY_XSAVE64): Likewise. (xsave): New int attribute. (fxsave): New instruction. (fxsave64): Likewise. (fxrstor): Likewise. (fxrstor64): Likewise. (<xsave>): Likewise. (<xsave>_rex64): Likewise. (xrstor): Likewise. (xrstor_rex64): Likewise. (xrstor64): Likewise. * gcc/config/i386/i386.opt (mfxsr): New. (mxsave): Likewise. (mxsaveopt): Likewise. * gcc/config/i386/x86intrin.h: Include xsaveintrin.h, fxsrintrin.h, xsaveoptintrin.h. testsuite/ChangeLog * gcc.target/i386/fxsave-1.c: New. * gcc.target/i386/fxsave64-1.c: Ditto. * gcc.target/i386/fxrstor-1.c: Ditto. * gcc.target/i386/fxrstor64-1.c: Ditto. * gcc.target/i386/xsave-1.c: Ditto. * gcc.target/i386/xsave64-1.c: Ditto. * gcc.target/i386/xrstor-1.c: Ditto. * gcc.target/i386/xrstor64-1.c: Ditto. * gcc.target/i386/xsaveopt-1.c: Ditto. * gcc.target/i386/xsaveopt64-1.c: Ditto. * gcc.target/i386/sse-12.c: Add -mfxsr, -mxsaveopt. * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192840 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/fxsrintrin.h')
-rw-r--r--gcc/config/i386/fxsrintrin.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/gcc/config/i386/fxsrintrin.h b/gcc/config/i386/fxsrintrin.h
new file mode 100644
index 00000000000..9f5e411ac32
--- /dev/null
+++ b/gcc/config/i386/fxsrintrin.h
@@ -0,0 +1,61 @@
+/* Copyright (C) 2012 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/>. */
+
+/* #if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED */
+/* # error "Never use <fxsrintrin.h> directly; include <x86intrin.h> instead." */
+/* #endif */
+
+#ifndef _FXSRINTRIN_H_INCLUDED
+#define _FXSRINTRIN_H_INCLUDED
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_fxsave (void *__P)
+{
+ return __builtin_ia32_fxsave (__P);
+}
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_fxrstor (void *__P)
+{
+ return __builtin_ia32_fxrstor (__P);
+}
+
+#ifdef __x86_64__
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_fxsave64 (void *__P)
+{
+ return __builtin_ia32_fxsave64 (__P);
+}
+
+extern __inline void
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_fxrstor64 (void *__P)
+{
+ return __builtin_ia32_fxrstor64 (__P);
+}
+#endif
+
+#endif /* _FXSRINTRIN_H_INCLUDED */