From be3a40e70b84a4615e36d5067e939d33f4da702e Mon Sep 17 00:00:00 2001 From: "james.brodman" Date: Tue, 27 Aug 2013 15:15:16 -0400 Subject: [PATCH] Fix for 3.4 --- ispc.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/ispc.cpp b/ispc.cpp index 8a0f16c6..2dd1a87d 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -288,7 +288,11 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_isa = Target::SSE2; this->m_nativeVectorWidth = 4; this->m_vectorWidth = 4; +#if defined(LLVM_3_4) + this->m_attributes = "+sse,+sse2,-sse3,-sse4.1,-sse4.2,-sse4a,-ssse3,-popcnt"; +#else this->m_attributes = "+sse,+sse2,-sse3,-sse41,-sse42,-sse4a,-ssse3,-popcnt"; +#endif this->m_maskingIsFree = false; this->m_maskBitCount = 32; } @@ -297,7 +301,11 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_isa = Target::SSE2; this->m_nativeVectorWidth = 4; this->m_vectorWidth = 8; +#if defined(LLVM_3_4) + this->m_attributes = "+sse,+sse2,-sse3,-sse4.1,-sse4.2,-sse4a,-ssse3,-popcnt"; +#else this->m_attributes = "+sse,+sse2,-sse3,-sse41,-sse42,-sse4a,-ssse3,-popcnt"; +#endif this->m_maskingIsFree = false; this->m_maskBitCount = 32; } @@ -307,7 +315,11 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_nativeVectorWidth = 4; this->m_vectorWidth = 4; // TODO: why not sse42 and popcnt? +#if defined(LLVM_3_4) + this->m_attributes = "+sse,+sse2,+sse3,+sse4.1,-sse4.2,-sse4a,+ssse3,-popcnt,+cmov"; +#else this->m_attributes = "+sse,+sse2,+sse3,+sse41,-sse42,-sse4a,+ssse3,-popcnt,+cmov"; +#endif this->m_maskingIsFree = false; this->m_maskBitCount = 32; } @@ -317,7 +329,11 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_isa = Target::SSE4; this->m_nativeVectorWidth = 4; this->m_vectorWidth = 8; +#if defined(LLVM_3_4) + this->m_attributes = "+sse,+sse2,+sse3,+sse4.1,-sse4.2,-sse4a,+ssse3,-popcnt,+cmov"; +#else this->m_attributes = "+sse,+sse2,+sse3,+sse41,-sse42,-sse4a,+ssse3,-popcnt,+cmov"; +#endif this->m_maskingIsFree = false; this->m_maskBitCount = 32; } @@ -325,7 +341,11 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_isa = Target::SSE4; this->m_nativeVectorWidth = 16; this->m_vectorWidth = 16; +#if defined(LLVM_3_4) + this->m_attributes = "+sse,+sse2,+sse3,+sse4.1,-sse4.2,-sse4a,+ssse3,-popcnt,+cmov"; +#else this->m_attributes = "+sse,+sse2,+sse3,+sse41,-sse42,-sse4a,+ssse3,-popcnt,+cmov"; +#endif this->m_maskingIsFree = false; this->m_maskBitCount = 8; } @@ -333,7 +353,11 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_isa = Target::SSE4; this->m_nativeVectorWidth = 8; this->m_vectorWidth = 8; +#if defined(LLVM_3_4) + this->m_attributes = "+sse,+sse2,+sse3,+sse4.1,-sse4.2,-sse4a,+ssse3,-popcnt,+cmov"; +#else this->m_attributes = "+sse,+sse2,+sse3,+sse41,-sse42,-sse4a,+ssse3,-popcnt,+cmov"; +#endif this->m_maskingIsFree = false; this->m_maskBitCount = 16; } @@ -425,7 +449,11 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_isa = Target::AVX11; this->m_nativeVectorWidth = 8; this->m_vectorWidth = 8; +#if defined(LLVM_3_4) + this->m_attributes = "+avx,+popcnt,+cmov,+f16c,+rdrnd"; +#else this->m_attributes = "+avx,+popcnt,+cmov,+f16c,+rdrand"; +#endif this->m_maskingIsFree = false; this->m_maskBitCount = 32; this->m_hasHalf = true; @@ -453,7 +481,11 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_isa = Target::AVX2; this->m_nativeVectorWidth = 8; this->m_vectorWidth = 8; +#if defined(LLVM_3_4) + this->m_attributes = "+avx2,+popcnt,+cmov,+f16c,+rdrnd" +#else this->m_attributes = "+avx2,+popcnt,+cmov,+f16c,+rdrand" +#endif #ifndef LLVM_3_1 ",+fma" #endif // !LLVM_3_1 @@ -472,7 +504,11 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_isa = Target::AVX2; this->m_nativeVectorWidth = 16; this->m_vectorWidth = 16; +#if defined(LLVM_3_4) + this->m_attributes = "+avx2,+popcnt,+cmov,+f16c,+rdrnd" +#else this->m_attributes = "+avx2,+popcnt,+cmov,+f16c,+rdrand" +#endif #ifndef LLVM_3_1 ",+fma" #endif // !LLVM_3_1