i386-common.c (OPTION_MASK_ISA_WAITPKG_SET, [...]): New defines.
authorSebastian Peryt <sebastian.peryt@intel.com>
Fri, 11 May 2018 13:17:42 +0000 (15:17 +0200)
committerSebastian Peryt <speryt@gcc.gnu.org>
Fri, 11 May 2018 13:17:42 +0000 (15:17 +0200)
commit55f31ed10fd38c50560114c47698ed0aa2b302c8
tree5be5eee255e124ed77f310e674dc92f07c1bc408
parentc40a8be80895679e8100e6ed32274bbed57d6543
i386-common.c (OPTION_MASK_ISA_WAITPKG_SET, [...]): New defines.

2018-05-11  Sebastian Peryt  <sebastian.peryt@intel.com>

gcc/

        * common/config/i386/i386-common.c (OPTION_MASK_ISA_WAITPKG_SET,
        OPTION_MASK_ISA_WAITPKG_UNSET): New defines.
        (ix86_handle_option): Handle -mwaitpkg.
        * config.gcc: New header.
        * config/i386/cpuid.h (bit_WAITPKG): New bit.
        * config/i386/driver-i386.c (host_detect_local_cpu): Detect -mwaitpkg.
        * config/i386/i386-builtin-types.def ((UINT8, UNSIGNED, UINT64)): New
        function type.
        * config/i386/i386-c.c (ix86_target_macros_internal): Handle
        OPTION_MASK_ISA_WAITPKG.
        * config/i386/i386.c (ix86_target_string): Add -mwaitpkg.
        (ix86_option_override_internal): Add PTA_WAITPKG.
        (ix86_valid_target_attribute_inner_p): Add -mwaitpkg.
        (enum ix86_builtins): Add IX86_BUILTIN_UMONITOR, IX86_BUILTIN_UMWAIT,
        IX86_BUILTIN_TPAUSE.
        (ix86_init_mmx_sse_builtins): Define __builtin_ia32_umonitor,
        __builtin_ia32_umwait and __builtin_ia32_tpause.
        (ix86_expand_builtin): Expand IX86_BUILTIN_UMONITOR,
        IX86_BUILTIN_UMWAIT, IX86_BUILTIN_TPAUSE.
        * config/i386/i386.h (TARGET_WAITPKG, TARGET_WAITPKG_P): New.
        * config/i386/i386.md (UNSPECV_UMWAIT, UNSPECV_UMONITOR,
        UNSPECV_TPAUSE): New.
        (umwait, umwait_rex64, umonitor_<mode>, tpause, tpause_rex64): New.
        * config/i386/i386.opt: Add -mwaitpkg.
        * config/i386/waitpkgintrin.h: New file.
        * config/i386/x86intrin.h: New header.
        * doc/invoke.texi: Add -mwaitpkg.

gcc/testsuite/

        * gcc.target/i386/tpause-1.c: New test.
        * gcc.target/i386/umonitor-1.c: New test.

From-SVN: r260161
17 files changed:
gcc/ChangeLog
gcc/common/config/i386/i386-common.c
gcc/config.gcc
gcc/config/i386/cpuid.h
gcc/config/i386/driver-i386.c
gcc/config/i386/i386-builtin-types.def
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/waitpkgintrin.h [new file with mode: 0644]
gcc/config/i386/x86intrin.h
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/tpause-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/umonitor-1.c [new file with mode: 0644]