diff options
Diffstat (limited to 'lib/mesa/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h')
-rw-r--r-- | lib/mesa/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/lib/mesa/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h b/lib/mesa/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h index c533984da..fe4c5dd38 100644 --- a/lib/mesa/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h +++ b/lib/mesa/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h @@ -30,20 +30,22 @@ #pragma once public: -enum class JIT_MEM_CLIENT +enum class MEM_CLIENT { MEM_CLIENT_INTERNAL, GFX_MEM_CLIENT_FETCH, GFX_MEM_CLIENT_SAMPLER, GFX_MEM_CLIENT_SHADER, + GFX_MEM_CLIENT_STREAMOUT, + GFX_MEM_CLIENT_URB }; protected: virtual Value* OFFSET_TO_NEXT_COMPONENT(Value* base, Constant* offset); -void AssertMemoryUsageParams(Value* ptr, JIT_MEM_CLIENT usage); +void AssertMemoryUsageParams(Value* ptr, MEM_CLIENT usage); public: -virtual Value* GEP(Value* Ptr, Value* Idx, Type* Ty = nullptr, const Twine& Name = ""); +virtual Value* GEP(Value* Ptr, Value* Idx, Type* Ty = nullptr, bool isReadOnly = true, const Twine& Name = ""); virtual Value* GEP(Type* Ty, Value* Ptr, Value* Idx, const Twine& Name = ""); virtual Value* GEP(Value* ptr, const std::initializer_list<Value*>& indexList, Type* Ty = nullptr); virtual Value* @@ -56,23 +58,23 @@ Value* IN_BOUNDS_GEP(Value* ptr, const std::initializer_list<Value*>& indexList) 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 = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL); + LOAD(Value* Ptr, const char* Name, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL); virtual LoadInst* LOAD(Value* Ptr, const Twine& Name = "", Type* Ty = nullptr, - JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL); + MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL); virtual LoadInst* - LOAD(Type* Ty, Value* Ptr, const Twine& Name = "", JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL); + LOAD(Type* Ty, Value* Ptr, const Twine& Name = "", MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL); virtual LoadInst* LOAD(Value* Ptr, bool isVolatile, const Twine& Name = "", Type* Ty = nullptr, - JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL); + MEM_CLIENT usage = 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 = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL); + MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL); virtual CallInst* MASKED_LOAD(Value* Ptr, unsigned Align, @@ -80,14 +82,24 @@ virtual CallInst* MASKED_LOAD(Value* Ptr, Value* PassThru = nullptr, const Twine& Name = "", Type* Ty = nullptr, - JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL) + MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) { return IRB()->CreateMaskedLoad(Ptr, Align, Mask, PassThru, Name); } -LoadInst* - LOADV(Value* BasePtr, const std::initializer_list<Value*>& offset, const llvm::Twine& name = ""); -StoreInst* STORE(Value* Val, Value* BasePtr, const std::initializer_list<uint32_t>& offset); +virtual StoreInst* STORE(Value *Val, Value *Ptr, bool isVolatile = false, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) +{ + return IRB()->CreateStore(Val, Ptr, isVolatile); +} + +virtual StoreInst* STORE(Value* Val, Value* BasePtr, const std::initializer_list<uint32_t>& offset, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL); + +virtual CallInst* MASKED_STORE(Value *Val, Value *Ptr, unsigned Align, Value *Mask, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) +{ + return IRB()->CreateMaskedStore(Val, Ptr, Align, Mask); +} + +LoadInst* LOADV(Value* BasePtr, const std::initializer_list<Value*>& offset, const llvm::Twine& name = ""); StoreInst* STOREV(Value* Val, Value* BasePtr, const std::initializer_list<Value*>& offset); Value* MEM_ADD(Value* i32Incr, @@ -101,14 +113,14 @@ void Gather4(const SWR_FORMAT format, Value* mask, Value* vGatherComponents[], bool bPackedOutput, - JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL); + MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL); virtual Value* GATHERPS(Value* src, Value* pBase, Value* indices, Value* mask, uint8_t scale = 1, - JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL); + MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL); void GATHER4PS(const SWR_FORMAT_INFO& info, Value* pSrcBase, @@ -116,14 +128,14 @@ void GATHER4PS(const SWR_FORMAT_INFO& info, Value* mask, Value* vGatherComponents[], bool bPackedOutput, - JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL); + MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL); virtual Value* GATHERDD(Value* src, Value* pBase, Value* indices, Value* mask, uint8_t scale = 1, - JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL); + MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL); void GATHER4DD(const SWR_FORMAT_INFO& info, Value* pSrcBase, @@ -131,17 +143,18 @@ void GATHER4DD(const SWR_FORMAT_INFO& info, Value* mask, Value* vGatherComponents[], bool bPackedOutput, - JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL); + MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL); Value* GATHERPD(Value* src, Value* pBase, Value* indices, Value* mask, uint8_t scale = 1); Value* GATHER_PTR(Value* pVecSrcPtr, Value* pVecMask, Value* pVecPassthru); +void SCATTER_PTR(Value* pVecDstPtr, Value* pVecSrc, Value* pVecMask); virtual void SCATTERPS(Value* pDst, Value* vSrc, Value* vOffsets, Value* vMask, - JIT_MEM_CLIENT usage = JIT_MEM_CLIENT::MEM_CLIENT_INTERNAL); + MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL); void Shuffle8bpcGather4(const SWR_FORMAT_INFO& info, Value* vGatherInput, |