'category' : 'debug_adv',
}],
+ ['JIT_OPTIMIZATION_LEVEL', {
+ 'type' : 'int',
+ 'default' : '-1',
+ 'desc' : ['JIT compile optimization level:',],
+ 'category' : 'debug',
+ 'control' : 'dropdown',
+ 'choices' : [
+ {
+ 'name' : 'Automatic',
+ 'desc' : 'Automatic based on other KNOB and build settings',
+ 'value' : -1,
+ },
+ {
+ 'name' : 'Debug',
+ 'desc' : 'No optimization: -O0',
+ 'value' : 0,
+ },
+ {
+ 'name' : 'Less',
+ 'desc' : 'Some optimization: -O1',
+ 'value' : 1,
+ },
+ {
+ 'name' : 'Optimize',
+ 'desc' : 'Default Clang / LLVM optimizations: -O2',
+ 'value' : 2,
+ },
+ {
+ 'name' : 'Aggressive',
+ 'desc' : 'Maximum optimization: -O3',
+ 'value' : 3,
+ },
+ ],
+ }],
+
['JIT_CACHE_DIR', {
'type' : 'std::string',
'default' : r'%TEMP%\SWR\JitCache' if sys.platform == 'win32' else '${HOME}/.swr/jitcache',
SIMD256T::testz_ps(a.v8[1], b.v8[1]));
}
-static SIMDINLINE int SIMDCALL testz_si(Integer const &a, Integer const &b) // return all_lanes_zero(a & b) ? 1 : 0 (int)
+static SIMDINLINE bool SIMDCALL testz_si(Integer const &a, Integer const &b) // return all_lanes_zero(a & b) ? 1 : 0 (int)
{
return 0 != (SIMD256T::testz_si(a.v8[0], b.v8[0]) &
SIMD256T::testz_si(a.v8[1], b.v8[1]));
/****************************************************************************
-* Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved.
+* Copyright (C) 2014-2018 Intel Corporation. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
AUX_MODE_DEPTH,
};
+struct SWR_LOD_OFFSETS
+{
+ uint32_t offsets[2][15];
+};
+
//////////////////////////////////////////////////////////////////////////
/// SWR_SURFACE_STATE
//////////////////////////////////////////////////////////////////////////
SWR_MULTISAMPLE_TYPE_COUNT
};
-INLINE uint32_t GetNumSamples(SWR_MULTISAMPLE_COUNT sampleCount) // @llvm_func_start
+static INLINE uint32_t GetNumSamples(/* SWR_SAMPLE_COUNT */ int sampleCountEnum) // @llvm_func_start
{
- static const uint32_t sampleCountLUT[SWR_MULTISAMPLE_TYPE_COUNT] {1, 2, 4, 8, 16};
- assert(sampleCount < SWR_MULTISAMPLE_TYPE_COUNT);
- return sampleCountLUT[sampleCount];
+ return uint32_t(1) << sampleCountEnum;
} // @llvm_func_end
struct SWR_BLEND_STATE
InitializeNativeTargetAsmPrinter();
InitializeNativeTargetDisassembler();
+
TargetOptions tOpts;
tOpts.AllowFPOpFusion = FPOpFusion::Fast;
tOpts.NoInfsFPMath = false;
//tOpts.PrintMachineCode = true;
- mCore = std::string(core);
- std::transform(mCore.begin(), mCore.end(), mCore.begin(), ::tolower);
-
std::unique_ptr<Module> newModule(new Module("", mContext));
mpCurrentModule = newModule.get();
auto optLevel = CodeGenOpt::Aggressive;
+ if (KNOB_JIT_OPTIMIZATION_LEVEL >= CodeGenOpt::None &&
+ KNOB_JIT_OPTIMIZATION_LEVEL <= CodeGenOpt::Aggressive)
+ {
+ optLevel = CodeGenOpt::Level(KNOB_JIT_OPTIMIZATION_LEVEL);
+ }
+
mpExec = EngineBuilder(std::move(newModule))
.setTargetOptions(tOpts)
.setOptLevel(optLevel)
llvm::FunctionType* mFetchShaderTy;
JitInstructionSet mArch;
- std::string mCore;
// Debugging support
std::unordered_map<llvm::StructType*, llvm::DIType*> mDebugStructMap;
{
mpfnTranslateGfxAddress = nullptr;
mpParamSimDC = nullptr;
+
}
void BuilderGfxMem::NotifyPrivateContextSet()
return Builder::LOAD(BasePtr, offset, name);
}
- Value* BuilderGfxMem::TranlsateGfxAddress(Value* xpGfxAddress)
+ Value* BuilderGfxMem::TranslateGfxAddress(Value* xpGfxAddress)
{
return INT_TO_PTR(xpGfxAddress, PointerType::get(mInt8Ty, 0));
}
-
}
virtual Value *GATHERDD(Value* src, Value* pBase, Value* indices, Value* mask, uint8_t scale = 1, JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
- Value* TranlsateGfxAddress(Value* xpGfxAddress);
+ Value* TranslateGfxAddress(Value* xpGfxAddress);
+
protected:
// Move builder to beginning of post loop
IRB()->SetInsertPoint(pPostLoop, pPostLoop->begin());
}
-
}
// Static stack allocations for scatter operations
Value* pScatterStackSrc{ nullptr };
Value* pScatterStackOffsets{ nullptr };
-
-
-
-//virtual Value* TRANSLATE_ADDRESS(Value* address) { return address; }