mArch(arch)
{
mpCurrentModule = nullptr;
- mpExec = nullptr;
+ mpExec = nullptr;
InitializeNativeTarget();
InitializeNativeTargetAsmPrinter();
//////////////////////////////////////////////////////////////////////////
/// @brief Dump function to file.
-void JitManager::DumpToFile(Module* M, const char* fileName, llvm::AssemblyAnnotationWriter* annotater)
+void JitManager::DumpToFile(Module* M,
+ const char* fileName,
+ llvm::AssemblyAnnotationWriter* annotater)
{
if (KNOB_DUMP_SHADER_IR)
{
mModuleCacheDir = moduleDir;
}
-
/// notifyObjectCompiled - Provides a pointer to compiled code for Module M.
void JitCache::notifyObjectCompiled(const llvm::Module* M, llvm::MemoryBufferRef Obj)
{
return pBuf;
}
-void InterleaveAssemblyAnnotater::emitInstructionAnnot(const llvm::Instruction *pInst, llvm::formatted_raw_ostream &OS)
+void InterleaveAssemblyAnnotater::emitInstructionAnnot(const llvm::Instruction* pInst,
+ llvm::formatted_raw_ostream& OS)
{
auto dbgLoc = pInst->getDebugLoc();
- if(dbgLoc)
+ if (dbgLoc)
{
unsigned int line = dbgLoc.getLine();
- if(line != mCurrentLineNo)
+ if (line != mCurrentLineNo)
{
- if(line > 0 && line <= mAssembly.size())
+ if (line > 0 && line <= mAssembly.size())
{
// HACK: here we assume that OS is a formatted_raw_ostream(ods())
// and modify the color accordingly. We can't do the color
// modification on OS because formatted_raw_ostream strips
// the color information. The only way to fix this behavior
// is to patch LLVM.
- OS << "\n; " << line << ": " << mAssembly[line-1] << "\n";
+ OS << "\n; " << line << ": " << mAssembly[line - 1] << "\n";
}
mCurrentLineNo = line;
}
}
}
-
break;
case R32_UINT:
(fetchState.bDisableIndexOOBCheck)
- ? vIndices = LOAD(indices, "", PointerType::get(mSimdInt32Ty, 0), JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH)
+ ? vIndices = LOAD(indices,
+ "",
+ PointerType::get(mSimdInt32Ty, 0),
+ JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH)
: vIndices = GetSimdValid32bitIndices(indices, pLastIndex);
break; // incoming type is already 32bit int
default:
Value* pGather;
if (info.bpp == 32)
{
- pGather = GATHERDD(VIMMED1(0), xpBase, pOffsets, pMask, 1, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
+ pGather =
+ GATHERDD(VIMMED1(0), xpBase, pOffsets, pMask, 1, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
}
else
{
BasicBlock* pCurrentBB = IRB()->GetInsertBlock();
BasicBlock* pMaskedLoadBlock =
BasicBlock::Create(JM()->mContext, "MaskedLaneLoad", pCurrentBB->getParent());
- BasicBlock* pEndLoadBB = BasicBlock::Create(JM()->mContext, "AfterMaskedLoad", pCurrentBB->getParent());
+ BasicBlock* pEndLoadBB =
+ BasicBlock::Create(JM()->mContext, "AfterMaskedLoad", pCurrentBB->getParent());
COND_BR(mask, pMaskedLoadBlock, pEndLoadBB);
{
case 8:
{
- Value* pDst = BITCAST(GEP(pDstMem, C(lane)), PointerType::get(mInt8Ty, 0));
+ Value* pDst = BITCAST(GEP(pDstMem, C(lane)), PointerType::get(mInt8Ty, 0));
Value* xpSrc = ADD(xpBase, Z_EXT(index, xpBase->getType()));
STORE(LOAD(xpSrc, "", mInt8PtrTy, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH), pDst);
break;
case 16:
{
- Value* pDst = BITCAST(GEP(pDstMem, C(lane)), PointerType::get(mInt16Ty, 0));
+ Value* pDst = BITCAST(GEP(pDstMem, C(lane)), PointerType::get(mInt16Ty, 0));
Value* xpSrc = ADD(xpBase, Z_EXT(index, xpBase->getType()));
STORE(LOAD(xpSrc, "", mInt16PtrTy, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH), pDst);
break;
case 24:
{
// First 16-bits of data
- Value* pDst = BITCAST(GEP(pDstMem, C(lane)), PointerType::get(mInt16Ty, 0));
+ Value* pDst = BITCAST(GEP(pDstMem, C(lane)), PointerType::get(mInt16Ty, 0));
Value* xpSrc = ADD(xpBase, Z_EXT(index, xpBase->getType()));
STORE(LOAD(xpSrc, "", mInt16PtrTy, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH), pDst);
// Last 8-bits of data
- pDst = BITCAST(GEP(pDst, C(1)), PointerType::get(mInt8Ty, 0));
+ pDst = BITCAST(GEP(pDst, C(1)), PointerType::get(mInt8Ty, 0));
xpSrc = ADD(xpSrc, C(2));
STORE(LOAD(xpSrc, "", mInt8PtrTy, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH), pDst);
break;
// if we have at least one component to fetch
if (compMask)
{
- Value* vGatherResult = GATHERDD(
- gatherSrc, pStreamBaseGFX, vOffsets, vGatherMask, 1, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
+ Value* vGatherResult = GATHERDD(gatherSrc,
+ pStreamBaseGFX,
+ vOffsets,
+ vGatherMask,
+ 1,
+ JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
// e.g. result of an 8x32bit integer gather for 8bit components
// 256i - 0 1 2 3 4 5 6 7
// xyzw xyzw xyzw xyzw xyzw xyzw xyzw xyzw
// if we have at least one component out of x or y to fetch
if (isComponentEnabled(compMask, 0) || isComponentEnabled(compMask, 1))
{
- vGatherResult[0] = GATHERDD(gatherSrc, pStreamBaseGFX, vOffsets, vGatherMask, 1, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
+ vGatherResult[0] = GATHERDD(gatherSrc,
+ pStreamBaseGFX,
+ vOffsets,
+ vGatherMask,
+ 1,
+ JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
// e.g. result of first 8x32bit integer gather for 16bit components
// 256i - 0 1 2 3 4 5 6 7
// xyxy xyxy xyxy xyxy xyxy xyxy xyxy xyxy
// offset base to the next components(zw) in the vertex to gather
pStreamBaseGFX = ADD(pStreamBaseGFX, C((int64_t)4));
- vGatherResult[1] = GATHERDD(gatherSrc, pStreamBaseGFX, vOffsets, vGatherMask, 1, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
+ vGatherResult[1] = GATHERDD(gatherSrc,
+ pStreamBaseGFX,
+ vOffsets,
+ vGatherMask,
+ 1,
+ JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
// e.g. result of second 8x32bit integer gather for 16bit components
// 256i - 0 1 2 3 4 5 6 7
// zwzw zwzw zwzw zwzw zwzw zwzw zwzw zwzw
// if we need to gather the component
if (compCtrl[i] == StoreSrc)
{
- Value* pGather =
- GATHERDD(gatherSrc, pStreamBaseGFX, vOffsets, vGatherMask, 1, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
+ Value* pGather = GATHERDD(gatherSrc,
+ pStreamBaseGFX,
+ vOffsets,
+ vGatherMask,
+ 1,
+ JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
if (conversionType == CONVERT_USCALED)
{