//////////////////////////////////////////////////////////////////////////
/// @brief Contructor for JitManager.
/// @param simdWidth - SIMD width to be used in generated program.
-JitManager::JitManager(uint32_t simdWidth, const char *arch)
+JitManager::JitManager(uint32_t simdWidth, const char *arch, const char* core)
: mContext(), mBuilder(mContext), mIsModuleFinalized(true), mJitNumber(0), mVWidth(simdWidth), mArch(arch)
{
InitializeNativeTarget();
//tOpts.PrintMachineCode = true;
+ mCore = std::string(core);
+ std::transform(mCore.begin(), mCore.end(), mCore.begin(), ::tolower);
+
std::stringstream fnName("JitModule", std::ios_base::in | std::ios_base::out | std::ios_base::ate);
fnName << mJitNumber++;
std::unique_ptr<Module> newModule(new Module(fnName.str(), mContext));
//////////////////////////////////////////////////////////////////////////
/// @brief Create JIT context.
/// @param simdWidth - SIMD width to be used in generated program.
- HANDLE JITCALL JitCreateContext(uint32_t targetSimdWidth, const char* arch)
+ HANDLE JITCALL JitCreateContext(uint32_t targetSimdWidth, const char* arch, const char* core)
{
- return new JitManager(targetSimdWidth, arch);
+ return new JitManager(targetSimdWidth, arch, core);
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
struct JitManager
{
- JitManager(uint32_t w, const char *arch);
+ JitManager(uint32_t w, const char* arch, const char* core);
~JitManager(){};
JitLLVMContext mContext; ///< LLVM compiler
FunctionType* mFetchShaderTy;
JitInstructionSet mArch;
+ std::string mCore;
void SetupNewModule();
bool SetupModuleFromIR(const uint8_t *pIR);
//////////////////////////////////////////////////////////////////////////
/// @brief Create JIT context.
-HANDLE JITCALL JitCreateContext(uint32_t targetSimdWidth, const char* arch);
+HANDLE JITCALL JitCreateContext(uint32_t targetSimdWidth, const char* arch, const char* core);
//////////////////////////////////////////////////////////////////////////
/// @brief Destroy JIT context.