2013-12-19 17:10:14 +00:00
|
|
|
/*
|
|
|
|
* Emitter.h
|
|
|
|
*
|
|
|
|
* ARMv7 ISA Emitter for code generation.
|
|
|
|
*
|
|
|
|
* David Miller, 2011.
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include "arm_coding.h"
|
|
|
|
#include "arm_registers.h"
|
|
|
|
//#include "arm_disasm.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace ARM
|
|
|
|
{
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Emitter - Reserved for use w/ static members ..
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
class Emitter
|
|
|
|
{
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(_DEBUG) || defined(DEBUG)
|
|
|
|
|
Partially working dyna for iOS. Very few games working atm.
This works, but is extremelly hacky. Must be started without attached debugger, lldb doesn't want to let go of EXC_BAD_ADDRESS, but reicast really depends on it getting delivered as SIGSEGV/SIGBUS. Also xcode has a really bad day upon seeing the jit code. Oh well.
There's some dynarec bug that causes color corruption on bios logo/boot triagles, TA crash on ikaruga and infinitive loop on crazy taxi. I'd guess some fp-memory-write thingy, abi, or smth. Too bad.
- Force code to compile in arm mode (arm jit -> thumb mem functions is complicated)
- SIGILL, SIGBUS. Works w/o Mach exceptions and EXC_BAD_ADDRESS
- Code buffers move to __TEXT, munmapped && memmapped to actually work
- Primitive input. Button + start, or left (works to get out of bios date screen)
- Fixup emitter for thumb2/interworking (didn't work though, reverted to arm cc)
- Block Manager: Disable mem saving / page fault alloc-on-demand logic
- Move cycle counter to r11, r9 is not clean on iOS. Remove r11 from reg alloc list
- Cache flushes for iOS
- log to log.txt
- load game.chd
2015-01-19 07:52:12 +00:00
|
|
|
#define EAPI static void
|
2013-12-19 17:10:14 +00:00
|
|
|
|
|
|
|
#define DECL_I \
|
|
|
|
u32 Instruction=0
|
|
|
|
|
|
|
|
#define DECL_Id(d) \
|
|
|
|
u32 Instruction=(d)
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
// #define _inlineExSVoidA __extension__ static __inline void __attribute__ ((__always_inline__))
|
|
|
|
|
|
|
|
#define EAPI \
|
|
|
|
inline static void
|
|
|
|
|
|
|
|
#define DECL_I \
|
|
|
|
static u32 Instruction; \
|
|
|
|
Instruction=0
|
|
|
|
|
|
|
|
#define DECL_Id(d) \
|
|
|
|
static u32 Instruction; \
|
|
|
|
Instruction=(d)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* TEMP
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#define I (Instruction)
|
|
|
|
|
|
|
|
#define SET_CC I |= (((u32)CC&15)<<28)
|
|
|
|
|
|
|
|
#ifndef EMIT_I
|
|
|
|
#define EMIT_I emit_Write32((I));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef EMIT_GET_PTR
|
|
|
|
#define EMIT_GET_PTR() emit_GetCCPtr()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ARM Core Instructions
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "E_Branches.h"
|
|
|
|
#include "E_DataOp.h"
|
|
|
|
#include "E_Multiply.h"
|
|
|
|
#include "E_Parallel.h"
|
|
|
|
#include "E_Extend.h"
|
|
|
|
#include "E_Misc.h"
|
|
|
|
#include "E_Status.h"
|
|
|
|
#include "E_LoadStore.h"
|
|
|
|
#include "E_Special.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ARM VFP/A.SIMD Extension Instructions
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "E_VLoadStore.h"
|
|
|
|
#include "E_VRegXfer.h"
|
|
|
|
#include "E_VDataOp.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Helper Routines & Psuedo-Instructions
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "H_psuedo.h"
|
|
|
|
|
|
|
|
#include "H_Branches.h"
|
|
|
|
#include "H_LoadStore.h"
|
|
|
|
|
|
|
|
//#include "H_state.h"
|
|
|
|
//#include "H_fp.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|