2014-04-05 18:30:08 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2015-08-26 04:54:06 +02:00
|
|
|
#include "SPUAnalyser.h"
|
2014-04-05 18:30:08 +02:00
|
|
|
|
2016-05-13 15:55:34 +02:00
|
|
|
#include <mutex>
|
|
|
|
|
|
2015-08-26 04:54:06 +02:00
|
|
|
// SPU Recompiler instance base (must be global or PS3 process-local)
|
2016-04-14 01:09:41 +02:00
|
|
|
class spu_recompiler_base
|
2014-04-05 18:30:08 +02:00
|
|
|
{
|
2015-08-26 04:54:06 +02:00
|
|
|
protected:
|
|
|
|
|
std::mutex m_mutex; // must be locked in compile()
|
2014-04-05 18:30:08 +02:00
|
|
|
|
2015-08-26 04:54:06 +02:00
|
|
|
const spu_function_t* m_func; // current function
|
2014-04-05 18:30:08 +02:00
|
|
|
|
2015-08-26 04:54:06 +02:00
|
|
|
u32 m_pos; // current position
|
2014-04-05 18:30:08 +02:00
|
|
|
|
2015-08-26 04:54:06 +02:00
|
|
|
public:
|
2017-01-25 00:22:19 +01:00
|
|
|
virtual ~spu_recompiler_base();
|
2014-04-05 18:30:08 +02:00
|
|
|
|
2016-04-14 01:09:41 +02:00
|
|
|
// Compile specified function
|
|
|
|
|
virtual void compile(spu_function_t& f) = 0;
|
2015-05-27 05:11:59 +02:00
|
|
|
|
2016-04-14 01:09:41 +02:00
|
|
|
// Run
|
|
|
|
|
static void enter(class SPUThread&);
|
2014-04-08 17:10:07 +02:00
|
|
|
};
|