intrinsic = "llvm.ppc.altivec.vminfp";
intr_size = 128;
}
- } else if ((LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9)) &&
+ } else if (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9 &&
util_cpu_caps.has_avx2 && type.length > 4) {
intr_size = 256;
switch (type.width) {
intrinsic = type.sign ? "llvm.x86.avx2.pmins.d" : "llvm.x86.avx2.pminu.d";
break;
}
- } else if ((LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9)) &&
+ } else if (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9 &&
util_cpu_caps.has_sse2 && type.length >= 2) {
intr_size = 128;
if ((type.width == 8 || type.width == 16) &&
LLVMTypeRef type = LLVMTypeOf(a);
assert(type == LLVMTypeOf(b));
assert(type == LLVMTypeOf(c));
- if (LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4)) {
+ if (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4) {
/* XXX: LLVM 3.3 does not breakdown llvm.fmuladd into mul+add when FMA is
* not supported, and instead it falls-back to a C function.
*/
intrinsic = "llvm.ppc.altivec.vmaxfp";
intr_size = 128;
}
- } else if ((LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9)) &&
+ } else if (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9 &&
util_cpu_caps.has_avx2 && type.length > 4) {
intr_size = 256;
switch (type.width) {
intrinsic = type.sign ? "llvm.x86.avx2.pmaxs.d" : "llvm.x86.avx2.pmaxu.d";
break;
}
- } else if ((LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9)) &&
+ } else if (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9 &&
util_cpu_caps.has_sse2 && type.length >= 2) {
intr_size = 128;
if ((type.width == 8 || type.width == 16) &&
return a;
if(type.floating) {
- if ((LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 6)) && (LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9))) {
+ if ((LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 6)) && (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9)) {
/* Workaround llvm.org/PR27332 */
LLVMTypeRef int_vec_type = lp_build_int_vec_type(bld->gallivm, type);
unsigned long long absMask = ~(1ULL << (type.width - 1));
#else
#include <llvm/Target/TargetLibraryInfo.h>
#endif
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6
#include <llvm/ExecutionEngine/JITMemoryManager.h>
#else
#include <llvm/ExecutionEngine/SectionMemoryManager.h>
extern "C" void
lp_set_target_options(void)
{
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4
/*
* By default LLVM adds a signal handler to output a pretty stack trace.
* This signal handler is never removed, causing problems when unloading the
gallivm_create_target_library_info(const char *triple)
{
return reinterpret_cast<LLVMTargetLibraryInfoRef>(
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7
new llvm::TargetLibraryInfo(
#else
new llvm::TargetLibraryInfoImpl(
gallivm_dispose_target_library_info(LLVMTargetLibraryInfoRef library_info)
{
delete reinterpret_cast<
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7
llvm::TargetLibraryInfo
#else
llvm::TargetLibraryInfoImpl
}
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4
extern "C"
void
#endif
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6
typedef llvm::JITMemoryManager BaseMemoryManager;
#else
typedef llvm::RTDyldMemoryManager BaseMemoryManager;
virtual BaseMemoryManager *mgr() const = 0;
public:
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6
/*
* From JITMemoryManager
*/
virtual void deallocateFunctionBody(void *Body) {
mgr()->deallocateFunctionBody(Body);
}
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4
virtual uint8_t *startExceptionTable(const llvm::Function *F,
uintptr_t &ActualSize) {
return mgr()->startExceptionTable(F, ActualSize);
bool AbortOnFailure=true) {
return mgr()->getPointerToNamedFunction(Name, AbortOnFailure);
}
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR <= 3)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 3
virtual bool applyPermissions(std::string *ErrMsg = 0) {
return mgr()->applyPermissions(ErrMsg);
}
* Deallocate things as previously requested and
* free shared manager when no longer used.
*/
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6
Vec::iterator i;
assert(TheMM);
for ( i = FunctionBody.begin(); i != FunctionBody.end(); ++i )
TheMM->deallocateFunctionBody(*i);
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4
for ( i = ExceptionTable.begin(); i != ExceptionTable.end(); ++i )
TheMM->deallocateExceptionTable(*i);
-#endif /* LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4) */
-#endif /* LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6) */
+#endif /* LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4 */
+#endif /* LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6 */
}
};
delete (GeneratedCode *) code;
}
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4
virtual void deallocateExceptionTable(void *ET) {
// remember for later deallocation
code->ExceptionTable.push_back(ET);
TargetOptions options;
#if defined(PIPE_ARCH_X86)
options.StackAlignmentOverride = 4;
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4
options.RealignStack = true;
#endif
#endif
-#if defined(DEBUG) && (LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7))
+#if defined(DEBUG) && (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7)
options.JITEmitDebugInfo = true;
#endif
/* XXX: Workaround http://llvm.org/PR21435 */
-#if defined(DEBUG) || defined(PROFILE) || \
- ((LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 3)) && (defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)))
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4)
+#if defined(DEBUG) || defined(PROFILE) || defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 4
options.NoFramePointerElimNonLeaf = true;
#endif
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7
options.NoFramePointerElim = true;
#endif
#endif
.setOptLevel((CodeGenOpt::Level)OptLevel);
if (useMCJIT) {
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6
builder.setUseMCJIT(true);
#endif
#ifdef _WIN32
builder.setJITMemoryManager(MM);
#endif
} else {
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6
BaseMemoryManager* JMM = reinterpret_cast<BaseMemoryManager*>(CMM);
MM = new ShaderMemoryManager(JMM);
*OutCode = MM->getGeneratedCode();
lp_get_default_memory_manager()
{
BaseMemoryManager *mm;
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 6
mm = llvm::JITMemoryManager::CreateDefaultMemManager();
#else
mm = new llvm::SectionMemoryManager();
#endif
}
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 9
static llvm::AtomicOrdering mapFromLLVMOrdering(LLVMAtomicOrdering Ordering) {
switch (Ordering) {
case LLVMAtomicOrderingNotAtomic: return llvm::AtomicOrdering::NotAtomic;
}
#endif
-#if LLVM_VERSION_MAJOR < 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 5)
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 5
LLVMValueRef LLVMBuildFence(LLVMBuilderRef B,
LLVMAtomicOrdering ordering,
LLVMBool singleThread,