swr: Fix build with llvm-9.0 again.
Commit6f7306c029
("swr/rast: Refactor memory API between rasterizer core and swr") unintentionally removed changes for llvm-9.0. Fixes:6f7306c029
("swr/rast: Refactor memory API between rasterizer core and swr") Fixes:5dd9ad1570
("swr/rasterizer: Better implementation of scatter") Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
This commit is contained in:
parent
20237166b6
commit
3664a6600e
|
@ -50,7 +50,11 @@ ${func['decl']}
|
||||||
%else:
|
%else:
|
||||||
FunctionType* pFuncTy = FunctionType::get(${ func['returnType'] }, {}, false);
|
FunctionType* pFuncTy = FunctionType::get(${ func['returnType'] }, {}, false);
|
||||||
%endif:
|
%endif:
|
||||||
|
#if LLVM_VERSION_MAJOR >= 9
|
||||||
|
Function* pFunc = cast<Function>(JM()->mpCurrentModule->getOrInsertFunction("meta.intrinsic.${func['name']}", pFuncTy).getCallee());
|
||||||
|
#else
|
||||||
Function* pFunc = cast<Function>(JM()->mpCurrentModule->getOrInsertFunction("meta.intrinsic.${func['name']}", pFuncTy));
|
Function* pFunc = cast<Function>(JM()->mpCurrentModule->getOrInsertFunction("meta.intrinsic.${func['name']}", pFuncTy));
|
||||||
|
#endif
|
||||||
return CALL(pFunc, std::initializer_list<Value*>{${argList}}, name);
|
return CALL(pFunc, std::initializer_list<Value*>{${argList}}, name);
|
||||||
%elif isIntrin:
|
%elif isIntrin:
|
||||||
%if len(func['types']) != 0:
|
%if len(func['types']) != 0:
|
||||||
|
|
|
@ -455,7 +455,11 @@ namespace SwrJit
|
||||||
args.push_back(PointerType::get(mInt8Ty, 0));
|
args.push_back(PointerType::get(mInt8Ty, 0));
|
||||||
FunctionType* callPrintTy = FunctionType::get(Type::getVoidTy(JM()->mContext), args, true);
|
FunctionType* callPrintTy = FunctionType::get(Type::getVoidTy(JM()->mContext), args, true);
|
||||||
Function* callPrintFn =
|
Function* callPrintFn =
|
||||||
|
#if LLVM_VERSION_MAJOR >= 9
|
||||||
|
cast<Function>(JM()->mpCurrentModule->getOrInsertFunction("CallPrint", callPrintTy).getCallee());
|
||||||
|
#else
|
||||||
cast<Function>(JM()->mpCurrentModule->getOrInsertFunction("CallPrint", callPrintTy));
|
cast<Function>(JM()->mpCurrentModule->getOrInsertFunction("CallPrint", callPrintTy));
|
||||||
|
#endif
|
||||||
|
|
||||||
// if we haven't yet added the symbol to the symbol table
|
// if we haven't yet added the symbol to the symbol table
|
||||||
if ((sys::DynamicLibrary::SearchForAddressOfSymbol("CallPrint")) == nullptr)
|
if ((sys::DynamicLibrary::SearchForAddressOfSymbol("CallPrint")) == nullptr)
|
||||||
|
@ -624,7 +628,11 @@ namespace SwrJit
|
||||||
{
|
{
|
||||||
FunctionType* pFuncTy = FunctionType::get(mFP32Ty, mInt16Ty);
|
FunctionType* pFuncTy = FunctionType::get(mFP32Ty, mInt16Ty);
|
||||||
Function* pCvtPh2Ps = cast<Function>(
|
Function* pCvtPh2Ps = cast<Function>(
|
||||||
|
#if LLVM_VERSION_MAJOR >= 9
|
||||||
|
JM()->mpCurrentModule->getOrInsertFunction("ConvertFloat16ToFloat32", pFuncTy).getCallee());
|
||||||
|
#else
|
||||||
JM()->mpCurrentModule->getOrInsertFunction("ConvertFloat16ToFloat32", pFuncTy));
|
JM()->mpCurrentModule->getOrInsertFunction("ConvertFloat16ToFloat32", pFuncTy));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sys::DynamicLibrary::SearchForAddressOfSymbol("ConvertFloat16ToFloat32") == nullptr)
|
if (sys::DynamicLibrary::SearchForAddressOfSymbol("ConvertFloat16ToFloat32") == nullptr)
|
||||||
{
|
{
|
||||||
|
@ -660,7 +668,11 @@ namespace SwrJit
|
||||||
// call scalar C function for now
|
// call scalar C function for now
|
||||||
FunctionType* pFuncTy = FunctionType::get(mInt16Ty, mFP32Ty);
|
FunctionType* pFuncTy = FunctionType::get(mInt16Ty, mFP32Ty);
|
||||||
Function* pCvtPs2Ph = cast<Function>(
|
Function* pCvtPs2Ph = cast<Function>(
|
||||||
|
#if LLVM_VERSION_MAJOR >= 9
|
||||||
|
JM()->mpCurrentModule->getOrInsertFunction("ConvertFloat32ToFloat16", pFuncTy).getCallee());
|
||||||
|
#else
|
||||||
JM()->mpCurrentModule->getOrInsertFunction("ConvertFloat32ToFloat16", pFuncTy));
|
JM()->mpCurrentModule->getOrInsertFunction("ConvertFloat32ToFloat16", pFuncTy));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sys::DynamicLibrary::SearchForAddressOfSymbol("ConvertFloat32ToFloat16") == nullptr)
|
if (sys::DynamicLibrary::SearchForAddressOfSymbol("ConvertFloat32ToFloat16") == nullptr)
|
||||||
{
|
{
|
||||||
|
@ -969,7 +981,11 @@ namespace SwrJit
|
||||||
|
|
||||||
FunctionType* pFuncTy = FunctionType::get(Type::getVoidTy(JM()->mContext), args, false);
|
FunctionType* pFuncTy = FunctionType::get(Type::getVoidTy(JM()->mContext), args, false);
|
||||||
Function* pFunc = cast<Function>(
|
Function* pFunc = cast<Function>(
|
||||||
|
#if LLVM_VERSION_MAJOR >= 9
|
||||||
|
JM()->mpCurrentModule->getOrInsertFunction("BucketManager_StartBucket", pFuncTy).getCallee());
|
||||||
|
#else
|
||||||
JM()->mpCurrentModule->getOrInsertFunction("BucketManager_StartBucket", pFuncTy));
|
JM()->mpCurrentModule->getOrInsertFunction("BucketManager_StartBucket", pFuncTy));
|
||||||
|
#endif
|
||||||
if (sys::DynamicLibrary::SearchForAddressOfSymbol("BucketManager_StartBucket") ==
|
if (sys::DynamicLibrary::SearchForAddressOfSymbol("BucketManager_StartBucket") ==
|
||||||
nullptr)
|
nullptr)
|
||||||
{
|
{
|
||||||
|
@ -994,7 +1010,11 @@ namespace SwrJit
|
||||||
|
|
||||||
FunctionType* pFuncTy = FunctionType::get(Type::getVoidTy(JM()->mContext), args, false);
|
FunctionType* pFuncTy = FunctionType::get(Type::getVoidTy(JM()->mContext), args, false);
|
||||||
Function* pFunc = cast<Function>(
|
Function* pFunc = cast<Function>(
|
||||||
|
#if LLVM_VERSION_MAJOR >= 9
|
||||||
|
JM()->mpCurrentModule->getOrInsertFunction("BucketManager_StopBucket", pFuncTy).getCallee());
|
||||||
|
#else
|
||||||
JM()->mpCurrentModule->getOrInsertFunction("BucketManager_StopBucket", pFuncTy));
|
JM()->mpCurrentModule->getOrInsertFunction("BucketManager_StopBucket", pFuncTy));
|
||||||
|
#endif
|
||||||
if (sys::DynamicLibrary::SearchForAddressOfSymbol("BucketManager_StopBucket") ==
|
if (sys::DynamicLibrary::SearchForAddressOfSymbol("BucketManager_StopBucket") ==
|
||||||
nullptr)
|
nullptr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -202,7 +202,11 @@ namespace SwrJit
|
||||||
|
|
||||||
FunctionType* pfnScatterTy = FunctionType::get(B->mVoidTy, args, false);
|
FunctionType* pfnScatterTy = FunctionType::get(B->mVoidTy, args, false);
|
||||||
mPfnScatter256 = cast<Function>(
|
mPfnScatter256 = cast<Function>(
|
||||||
|
#if LLVM_VERSION_MAJOR >= 9
|
||||||
|
B->JM()->mpCurrentModule->getOrInsertFunction("ScatterPS_256", pfnScatterTy).getCallee());
|
||||||
|
#else
|
||||||
B->JM()->mpCurrentModule->getOrInsertFunction("ScatterPS_256", pfnScatterTy));
|
B->JM()->mpCurrentModule->getOrInsertFunction("ScatterPS_256", pfnScatterTy));
|
||||||
|
#endif
|
||||||
if (sys::DynamicLibrary::SearchForAddressOfSymbol("ScatterPS_256") == nullptr)
|
if (sys::DynamicLibrary::SearchForAddressOfSymbol("ScatterPS_256") == nullptr)
|
||||||
{
|
{
|
||||||
sys::DynamicLibrary::AddSymbol("ScatterPS_256", (void*)&ScatterPS_256);
|
sys::DynamicLibrary::AddSymbol("ScatterPS_256", (void*)&ScatterPS_256);
|
||||||
|
|
Loading…
Reference in New Issue