swr/rast: Start refactoring of builder/packetizer.
[mesa.git] / src / gallium / drivers / swr / rasterizer / jitter / JitManager.cpp
index 8092c14402521718f7655ce4b407fa8d6ec21d3f..bfb1d2e0c8b078db98a616538894d336abe876aa 100644 (file)
@@ -47,7 +47,7 @@
 #define JITTER_OUTPUT_DIR SWR_OUTPUT_DIR "\\Jitter"
 #endif // _WIN32
 
-#if defined(__APPLE) || defined(FORCE_LINUX) || defined(__linux__) || defined(__gnu_linux__)
+#if defined(__APPLE__) || defined(FORCE_LINUX) || defined(__linux__) || defined(__gnu_linux__)
 #include <pwd.h>
 #include <sys/stat.h>
 #endif
@@ -71,11 +71,6 @@ JitManager::JitManager(uint32_t simdWidth, const char *arch, const char* core)
     tOpts.NoInfsFPMath = false;
     tOpts.NoNaNsFPMath = false;
     tOpts.UnsafeFPMath = false;
-#if defined(_DEBUG)
-#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7
-    tOpts.NoFramePointerElim = true;
-#endif
-#endif
 
     //tOpts.PrintMachineCode    = true;
 
@@ -249,15 +244,9 @@ DIType* JitManager::GetDebugType(Type* pTy)
     switch (id)
     {
     case Type::VoidTyID: return builder.createUnspecifiedType("void"); break;
-#if LLVM_VERSION_MAJOR >= 4
     case Type::HalfTyID: return builder.createBasicType("float16", 16, dwarf::DW_ATE_float); break;
     case Type::FloatTyID: return builder.createBasicType("float", 32, dwarf::DW_ATE_float); break;
     case Type::DoubleTyID: return builder.createBasicType("double", 64, dwarf::DW_ATE_float); break;
-#else      
-    case Type::HalfTyID: return builder.createBasicType("float16", 16, 0, dwarf::DW_ATE_float); break;
-    case Type::FloatTyID: return builder.createBasicType("float", 32, 0, dwarf::DW_ATE_float); break;
-    case Type::DoubleTyID: return builder.createBasicType("double", 64, 0, dwarf::DW_ATE_float); break;
-#endif      
     case Type::IntegerTyID: return GetDebugIntegerType(pTy); break;
     case Type::StructTyID: return GetDebugStructType(pTy); break;
     case Type::ArrayTyID: return GetDebugArrayType(pTy); break;
@@ -294,19 +283,12 @@ DIType* JitManager::GetDebugIntegerType(Type* pTy)
     IntegerType* pIntTy = cast<IntegerType>(pTy);
     switch (pIntTy->getBitWidth())
     {
-#if LLVM_VERSION_MAJOR >= 4
     case 1: return builder.createBasicType("int1", 1, dwarf::DW_ATE_unsigned); break;
     case 8: return builder.createBasicType("int8", 8, dwarf::DW_ATE_signed); break;
     case 16: return builder.createBasicType("int16", 16, dwarf::DW_ATE_signed); break;
     case 32: return builder.createBasicType("int", 32, dwarf::DW_ATE_signed); break;
     case 64: return builder.createBasicType("int64", 64, dwarf::DW_ATE_signed); break;
-#else      
-    case 1: return builder.createBasicType("int1", 1, 0, dwarf::DW_ATE_unsigned); break;
-    case 8: return builder.createBasicType("int8", 8, 0, dwarf::DW_ATE_signed); break;
-    case 16: return builder.createBasicType("int16", 16, 0, dwarf::DW_ATE_signed); break;
-    case 32: return builder.createBasicType("int", 32, 0, dwarf::DW_ATE_signed); break;
-    case 64: return builder.createBasicType("int64", 64, 0, dwarf::DW_ATE_signed); break;
-#endif      
+    case 128: return builder.createBasicType("int128", 128, dwarf::DW_ATE_signed); break;
     default: SWR_ASSERT(false, "Unimplemented integer bit width");
     }
     return nullptr;
@@ -551,7 +533,7 @@ static inline uint32_t ComputeModuleCRC(const llvm::Module* M)
 /// constructor
 JitCache::JitCache()
 {
-#if defined(__APPLE) || defined(FORCE_LINUX) || defined(__linux__) || defined(__gnu_linux__)
+#if defined(__APPLE__) || defined(FORCE_LINUX) || defined(__linux__) || defined(__gnu_linux__)
     if (strncmp(KNOB_JIT_CACHE_DIR.c_str(), "~/", 2) == 0) {
         char *homedir;
         if (!(homedir = getenv("HOME"))) {