rpcsx/rpcs3/Emu/Cell/SPUInterpreter.h

43 lines
855 B
C
Raw Normal View History

#pragma once
#include "SPUOpcodes.h"
2015-01-18 19:19:10 +01:00
class spu_thread;
2015-01-18 19:19:10 +01:00
using spu_intrp_func_t = bool(*)(spu_thread& spu, spu_opcode_t op);
template <typename IT>
struct spu_interpreter_t;
2016-04-14 01:09:41 +02:00
struct spu_interpreter
2015-01-18 19:19:10 +01:00
{
static void set_interrupt_status(spu_thread&, spu_opcode_t);
2016-04-14 01:09:41 +02:00
};
struct spu_interpreter_rt_base
2016-04-14 01:09:41 +02:00
{
protected:
std::unique_ptr<spu_interpreter_t<spu_intrp_func_t>> ptrs;
spu_interpreter_rt_base() noexcept;
spu_interpreter_rt_base(const spu_interpreter_rt_base&) = delete;
spu_interpreter_rt_base& operator=(const spu_interpreter_rt_base&) = delete;
virtual ~spu_interpreter_rt_base();
2016-04-14 01:09:41 +02:00
};
struct spu_interpreter_rt : spu_interpreter_rt_base
2016-04-14 01:09:41 +02:00
{
spu_interpreter_rt() noexcept;
spu_intrp_func_t decode(u32 op) const noexcept
{
return table.decode(op);
}
private:
spu_decoder<spu_interpreter_t<spu_intrp_func_t>, spu_intrp_func_t> table;
2017-12-16 01:19:21 +01:00
};