virtual LoadInst* LOAD(Value* Ptr,
const char* Name,
Type* Ty = nullptr,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual LoadInst* LOAD(Value* Ptr,
const Twine& Name = "",
Type* Ty = nullptr,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual LoadInst* LOAD(Value* Ptr,
bool isVolatile,
const Twine& Name = "",
Type* Ty = nullptr,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual LoadInst* LOAD(Value* BasePtr,
const std::initializer_list<uint32_t>& offset,
const llvm::Twine& Name = "",
Type* Ty = nullptr,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual CallInst* MASKED_LOAD(Value* Ptr,
Value* PassThru = nullptr,
const Twine& Name = "",
Type* Ty = nullptr,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual Value* GATHERPS(Value* src,
Value* pBase,
Value* indices,
Value* mask,
uint8_t scale = 1,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual Value* GATHERDD(Value* src,
Value* pBase,
Value* indices,
Value* mask,
uint8_t scale = 1,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual void SCATTERPS(Value* pDst,
Value* vSrc,
Value* vOffsets,
Value* vMask,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
Value* TranslateGfxAddressForRead(Value* xpGfxAddress,
Type* PtrTy = nullptr,
const Twine& Name = "",
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
Value* TranslateGfxAddressForWrite(Value* xpGfxAddress,
Type* PtrTy = nullptr,
const Twine& Name = "",
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
protected:
#pragma once
public:
-typedef enum _JIT_MEM_CLIENT
+enum class JIT_MEM_CLIENT
{
MEM_CLIENT_INTERNAL,
GFX_MEM_CLIENT_FETCH,
GFX_MEM_CLIENT_SAMPLER,
GFX_MEM_CLIENT_SHADER,
-} JIT_MEM_CLIENT;
+};
protected:
virtual Value* OFFSET_TO_NEXT_COMPONENT(Value* base, Constant* offset);
Value* IN_BOUNDS_GEP(Value* ptr, const std::initializer_list<uint32_t>& indexList);
virtual LoadInst*
- LOAD(Value* Ptr, const char* Name, Type* Ty = nullptr, JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ LOAD(Value* Ptr, const char* Name, Type* Ty = nullptr, JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual LoadInst* LOAD(Value* Ptr,
const Twine& Name = "",
Type* Ty = nullptr,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual LoadInst*
- LOAD(Type* Ty, Value* Ptr, const Twine& Name = "", JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ LOAD(Type* Ty, Value* Ptr, const Twine& Name = "", JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual LoadInst* LOAD(Value* Ptr,
bool isVolatile,
const Twine& Name = "",
Type* Ty = nullptr,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual LoadInst* LOAD(Value* BasePtr,
const std::initializer_list<uint32_t>& offset,
const llvm::Twine& Name = "",
Type* Ty = nullptr,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual CallInst* MASKED_LOAD(Value* Ptr,
unsigned Align,
Value* PassThru = nullptr,
const Twine& Name = "",
Type* Ty = nullptr,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL)
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL)
{
return IRB()->CreateMaskedLoad(Ptr, Align, Mask, PassThru, Name);
}
Value* mask,
Value* vGatherComponents[],
bool bPackedOutput,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual Value* GATHERPS(Value* src,
Value* pBase,
Value* indices,
Value* mask,
uint8_t scale = 1,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
void GATHER4PS(const SWR_FORMAT_INFO& info,
Value* pSrcBase,
Value* mask,
Value* vGatherComponents[],
bool bPackedOutput,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual Value* GATHERDD(Value* src,
Value* pBase,
Value* indices,
Value* mask,
uint8_t scale = 1,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
void GATHER4DD(const SWR_FORMAT_INFO& info,
Value* pSrcBase,
Value* mask,
Value* vGatherComponents[],
bool bPackedOutput,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
Value* GATHERPD(Value* src, Value* pBase, Value* indices, Value* mask, uint8_t scale = 1);
Value* vSrc,
Value* vOffsets,
Value* vMask,
- JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
+ JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL);
void Shuffle8bpcGather4(const SWR_FORMAT_INFO& info,
Value* vGatherInput,
break;
case R32_UINT:
(fetchState.bDisableIndexOOBCheck)
- ? vIndices = LOAD(indices, "", PointerType::get(mSimdInt32Ty, 0), 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);
+ pGather = GATHERDD(VIMMED1(0), xpBase, pOffsets, pMask, 1, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
}
else
{
{
Value* pDst = BITCAST(GEP(pDstMem, C(lane)), PointerType::get(mInt8Ty, 0));
Value* xpSrc = ADD(xpBase, Z_EXT(index, xpBase->getType()));
- STORE(LOAD(xpSrc, "", mInt8PtrTy, GFX_MEM_CLIENT_FETCH), pDst);
+ STORE(LOAD(xpSrc, "", mInt8PtrTy, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH), pDst);
break;
}
{
Value* pDst = BITCAST(GEP(pDstMem, C(lane)), PointerType::get(mInt16Ty, 0));
Value* xpSrc = ADD(xpBase, Z_EXT(index, xpBase->getType()));
- STORE(LOAD(xpSrc, "", mInt16PtrTy, GFX_MEM_CLIENT_FETCH), pDst);
+ STORE(LOAD(xpSrc, "", mInt16PtrTy, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH), pDst);
break;
}
break;
// First 16-bits of data
Value* pDst = BITCAST(GEP(pDstMem, C(lane)), PointerType::get(mInt16Ty, 0));
Value* xpSrc = ADD(xpBase, Z_EXT(index, xpBase->getType()));
- STORE(LOAD(xpSrc, "", mInt16PtrTy, GFX_MEM_CLIENT_FETCH), pDst);
+ 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));
xpSrc = ADD(xpSrc, C(2));
- STORE(LOAD(xpSrc, "", mInt8PtrTy, GFX_MEM_CLIENT_FETCH), pDst);
+ STORE(LOAD(xpSrc, "", mInt8PtrTy, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH), pDst);
break;
}
vNewOffsets,
vGatherMask,
1,
- GFX_MEM_CLIENT_FETCH);
+ JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
}
else
{
if (compMask)
{
Value* vGatherResult = GATHERDD(
- gatherSrc, pStreamBaseGFX, vOffsets, vGatherMask, 1, GFX_MEM_CLIENT_FETCH);
+ 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);
+ 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);
+ 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 (compCtrl[i] == StoreSrc)
{
Value* pGather =
- GATHERDD(gatherSrc, pStreamBaseGFX, vOffsets, vGatherMask);
+ GATHERDD(gatherSrc, pStreamBaseGFX, vOffsets, vGatherMask, 1, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
if (conversionType == CONVERT_USCALED)
{
// if valid, load the index. if not, load 0 from the stack
Value* pValid = SELECT(mask, pIndex, pZeroIndex);
- Value* index = LOAD(pValid, "valid index", Ty, GFX_MEM_CLIENT_FETCH);
+ Value* index = LOAD(pValid, "valid index", Ty, JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
// zero extended index to 32 bits and insert into the correct simd lane
index = Z_EXT(index, mInt32Ty);
VIMMED1(0),
"vIndices",
PointerType::get(mSimdInt32Ty, 0),
- GFX_MEM_CLIENT_FETCH);
+ JIT_MEM_CLIENT::GFX_MEM_CLIENT_FETCH);
}
//////////////////////////////////////////////////////////////////////////