From 891b30ac8d1ab36c3a756fc885d22d40f080f386 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 5 Apr 2017 17:33:49 +0200 Subject: [PATCH] re PR target/80298 ( incompatible with -mno-sse) PR target/80298 * config/i386/mmintrin.h: Add -msse target option when __SSE__ is not defined for x86_64 target. Add -mmmx target option when __SSE2__ is not defined. * config/i386/mm3dnow.h: Add -msse target when __SSE__ is not defined for x86_64 target. Handle -m3dnowa option. From-SVN: r246708 --- gcc/ChangeLog | 9 +++++++++ gcc/config/i386/mm3dnow.h | 29 ++++++++++++++++++++++------- gcc/config/i386/mmintrin.h | 10 +++++++--- 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 951e0401ed1..0596b6d6053 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2017-04-05 Uros Bizjak + + PR target/80298 + * config/i386/mmintrin.h: Add -msse target option when __SSE__ is + not defined for x86_64 target. Add -mmmx target option when __SSE2__ + is not defined. + * config/i386/mm3dnow.h: Add -msse target when __SSE__ is not defined + for x86_64 target. Handle -m3dnowa option. + 2017-04-05 Vladimir Makarov PR rtl-optimization/70703 diff --git a/gcc/config/i386/mm3dnow.h b/gcc/config/i386/mm3dnow.h index c8a91a16073..2d5c538493c 100644 --- a/gcc/config/i386/mm3dnow.h +++ b/gcc/config/i386/mm3dnow.h @@ -30,9 +30,13 @@ #include #include -#ifndef __3dNOW__ +#if defined __x86_64__ && !defined __SSE__ || !defined __3dNOW__ #pragma GCC push_options +#ifdef __x86_64__ +#pragma GCC target("sse,3dnow") +#else #pragma GCC target("3dnow") +#endif #define __DISABLE_3dNOW__ #endif /* __3dNOW__ */ @@ -176,7 +180,20 @@ _m_to_float (__m64 __A) return __tmp.a[0]; } -#ifdef __3dNOW_A__ +#ifdef __DISABLE_3dNOW__ +#undef __DISABLE_3dNOW__ +#pragma GCC pop_options +#endif /* __DISABLE_3dNOW__ */ + +#if defined __x86_64__ && !defined __SSE__ || !defined __3dNOW_A__ +#pragma GCC push_options +#ifdef __x86_64__ +#pragma GCC target("sse,3dnowa") +#else +#pragma GCC target("3dnowa") +#endif +#define __DISABLE_3dNOW_A__ +#endif /* __3dNOW_A__ */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pf2iw (__m64 __A) @@ -208,11 +225,9 @@ _m_pswapd (__m64 __A) return (__m64)__builtin_ia32_pswapdsf ((__v2sf)__A); } -#endif /* __3dNOW_A__ */ - -#ifdef __DISABLE_3dNOW__ -#undef __DISABLE_3dNOW__ +#ifdef __DISABLE_3dNOW_A__ +#undef __DISABLE_3dNOW_A__ #pragma GCC pop_options -#endif /* __DISABLE_3dNOW__ */ +#endif /* __DISABLE_3dNOW_A__ */ #endif /* _MM3DNOW_H_INCLUDED */ diff --git a/gcc/config/i386/mmintrin.h b/gcc/config/i386/mmintrin.h index 957d766e95c..2cb73e34e91 100644 --- a/gcc/config/i386/mmintrin.h +++ b/gcc/config/i386/mmintrin.h @@ -27,9 +27,13 @@ #ifndef _MMINTRIN_H_INCLUDED #define _MMINTRIN_H_INCLUDED -#ifndef __MMX__ +#if defined __x86_64__ && !defined __SSE__ || !defined __MMX__ #pragma GCC push_options +#ifdef __x86_64__ +#pragma GCC target("sse,mmx") +#else #pragma GCC target("mmx") +#endif #define __DISABLE_MMX__ #endif /* __MMX__ */ @@ -311,7 +315,7 @@ _m_paddd (__m64 __m1, __m64 __m2) /* Add the 64-bit values in M1 to the 64-bit values in M2. */ #ifndef __SSE2__ #pragma GCC push_options -#pragma GCC target("sse2") +#pragma GCC target("sse2,mmx") #define __DISABLE_SSE2__ #endif /* __SSE2__ */ @@ -423,7 +427,7 @@ _m_psubd (__m64 __m1, __m64 __m2) /* Add the 64-bit values in M1 to the 64-bit values in M2. */ #ifndef __SSE2__ #pragma GCC push_options -#pragma GCC target("sse2") +#pragma GCC target("sse2,mmx") #define __DISABLE_SSE2__ #endif /* __SSE2__ */