diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-10 17:09:04 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-10 17:09:04 +0000 |
commit | b8190fde2cd04078f8448576fb021060526b51d5 (patch) | |
tree | 07e6f7b8e7f2e100f0948704bfb12de29858cde2 /libitm/config | |
parent | 15aefa66eea98ad9cfdf9860acb004c18055d46f (diff) | |
download | gcc-b8190fde2cd04078f8448576fb021060526b51d5.tar.gz |
libitm: Don't add -mavx if the assembler doesn't support avx.
* config/x86/x86_avx.cc: Remove #undef __AVX__ hack. Tidy comments.
* Makefile.am (x86_avx.lo): Only add -mavx if ARCH_X86_AVX.
* configure.ac (ARCH_X86_AVX): New conditional.
* Makefile.in, configure: Rebuild.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181261 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libitm/config')
-rw-r--r-- | libitm/config/x86/x86_avx.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/libitm/config/x86/x86_avx.cc b/libitm/config/x86/x86_avx.cc index cd20fe25cdc..6a5e297116b 100644 --- a/libitm/config/x86/x86_avx.cc +++ b/libitm/config/x86/x86_avx.cc @@ -24,24 +24,20 @@ #include "config.h" -// ??? This is pretty gross, but we're going to frob types of the functions. -// Is this better or worse than just admitting we need to do this in pure -// assembly? - -#ifndef HAVE_AS_AVX -#undef __AVX__ -#endif - #include "libitm_i.h" #include "dispatch.h" extern "C" { #ifndef HAVE_AS_AVX +// If we don't have an AVX capable assembler, we didn't set -mavx on the +// command-line either, which means that libitm.h defined neither this type +// nor the functions in this file. Define the type and unconditionally +// wrap the file in extern "C" to make up for the lack of pre-declaration. typedef float _ITM_TYPE_M256 __attribute__((vector_size(32), may_alias)); #endif -// ??? Re-define the memcpy implementations so that we can frob the +// Re-define the memcpy implementations so that we can frob the // interface to deal with possibly missing AVX instruction set support. #ifdef HAVE_AS_AVX @@ -52,10 +48,10 @@ typedef float _ITM_TYPE_M256 __attribute__((vector_size(32), may_alias)); #else /* Emit vmovaps (%rax),%ymm0. */ #define RETURN(X) \ - asm volatile(".byte 0xc5,0xfc,0x28,0x00" : "=m"(X) : "a"(&X)); + asm volatile(".byte 0xc5,0xfc,0x28,0x00" : "=m"(X) : "a"(&X)) /* Emit vmovaps %ymm0,(%rax); vzeroupper. */ #define STORE(X,Y) \ - asm volatile(".byte 0xc5,0xfc,0x29,0x00,0xc5,0xf8,0x77" : "=m"(X) : "a"(&X)); + asm volatile(".byte 0xc5,0xfc,0x29,0x00,0xc5,0xf8,0x77" : "=m"(X) : "a"(&X)) #define OUTPUT(T) void #define INPUT(T,X) #endif @@ -92,4 +88,4 @@ _ITM_LM256 (const _ITM_TYPE_M256 *ptr) GTM::GTM_LB (ptr, sizeof (*ptr)); } -} +} // extern "C" |