SPU LLVM: LS Memory Mirrors (Optimize loads/stores)

This commit is contained in:
Eladash 2020-07-15 21:57:39 +03:00 committed by Ivan
parent c1a80b8146
commit af1ceb1151
5 changed files with 104 additions and 31 deletions

View file

@ -118,6 +118,11 @@ enum : u32
SPU_STATUS_IS_ISOLATED = 0x80,
};
enum : s32
{
SPU_LS_SIZE = 0x40000,
};
enum : u32
{
SYS_SPU_THREAD_BASE_LOW = 0xf0000000,
@ -636,6 +641,7 @@ public:
const u32 index; // SPU index
const u32 offset; // SPU LS offset
const std::add_pointer_t<u8> ls; // SPU LS pointer
private:
lv2_spu_group* const group; // SPU Thread Group (only safe to access in the spu thread itself)
public:
@ -682,7 +688,7 @@ public:
template<typename T>
inline to_be_t<T>* _ptr(u32 lsa)
{
return static_cast<to_be_t<T>*>(vm::base(offset + lsa));
return reinterpret_cast<to_be_t<T>*>(ls + lsa);
}
// Convert specified SPU LS address to a reference of specified (possibly converted to BE) type