2012-11-15 00:39:56 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
2015-08-26 04:54:06 +02:00
|
|
|
#include "SPUOpcodes.h"
|
2015-01-18 19:19:10 +01:00
|
|
|
|
2018-10-11 00:17:19 +02:00
|
|
|
class spu_thread;
|
2015-01-18 19:19:10 +01:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
using spu_intrp_func_t = bool(*)(spu_thread& spu, spu_opcode_t op);
|
|
|
|
|
|
|
|
|
|
template <typename IT>
|
|
|
|
|
struct spu_interpreter_t;
|
2012-11-15 00:39:56 +01:00
|
|
|
|
2016-04-14 01:09:41 +02:00
|
|
|
struct spu_interpreter
|
2015-01-18 19:19:10 +01:00
|
|
|
{
|
2018-10-11 00:17:19 +02:00
|
|
|
static void set_interrupt_status(spu_thread&, spu_opcode_t);
|
2016-04-14 01:09:41 +02:00
|
|
|
};
|
2015-08-26 04:54:06 +02:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
struct spu_interpreter_rt_base
|
2016-04-14 01:09:41 +02:00
|
|
|
{
|
2021-12-30 17:39:18 +01: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
|
|
|
};
|
2015-08-26 04:54:06 +02:00
|
|
|
|
2021-12-30 17:39:18 +01:00
|
|
|
struct spu_interpreter_rt : spu_interpreter_rt_base
|
2016-04-14 01:09:41 +02:00
|
|
|
{
|
2021-12-30 17:39:18 +01: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
|
|
|
};
|