@@ -172,18 +172,6 @@ void* ATTR_MS_ABI PPCRecompiler_virtualHLE(PPCInterpreter_t* hCPU, uint32 hleFun
172
172
return PPCInterpreter_getCurrentInstance ();
173
173
}
174
174
175
- void ATTR_MS_ABI PPCRecompiler_getTBL (PPCInterpreter_t* hCPU, uint32 gprIndex)
176
- {
177
- uint64 coreTime = coreinit::coreinit_getTimerTick ();
178
- hCPU->gpr [gprIndex] = (uint32)(coreTime&0xFFFFFFFF );
179
- }
180
-
181
- void ATTR_MS_ABI PPCRecompiler_getTBU (PPCInterpreter_t* hCPU, uint32 gprIndex)
182
- {
183
- uint64 coreTime = coreinit::coreinit_getTimerTick ();
184
- hCPU->gpr [gprIndex] = (uint32)((coreTime>>32 )&0xFFFFFFFF );
185
- }
186
-
187
175
bool PPCRecompilerX64Gen_imlInstruction_macro (PPCRecFunction_t* PPCRecFunction, ppcImlGenContext_t* ppcImlGenContext, x64GenContext_t* x64GenContext, IMLInstruction* imlInstruction)
188
176
{
189
177
if (imlInstruction->operation == PPCREC_IML_MACRO_B_TO_REG)
@@ -340,43 +328,6 @@ bool PPCRecompilerX64Gen_imlInstruction_macro(PPCRecFunction_t* PPCRecFunction,
340
328
x64Gen_jmp_memReg64 (x64GenContext, X86_REG_RAX, (uint32)offsetof (PPCRecompilerInstanceData_t, ppcRecompilerDirectJumpTable));
341
329
return true ;
342
330
}
343
- else if ( imlInstruction->operation == PPCREC_IML_MACRO_MFTB )
344
- {
345
- // according to MS ABI the caller needs to save:
346
- // RAX, RCX, RDX, R8, R9, R10, R11
347
-
348
- uint32 ppcAddress = imlInstruction->op_macro .param ;
349
- uint32 sprId = imlInstruction->op_macro .param2 &0xFFFF ;
350
- uint32 gprIndex = (imlInstruction->op_macro .param2 >>16 )&0x1F ;
351
- // update instruction pointer
352
- x64Gen_mov_mem32Reg64_imm32 (x64GenContext, X86_REG_RSP, offsetof (PPCInterpreter_t, instructionPointer), ppcAddress);
353
- // set parameters
354
- x64Gen_mov_reg64_reg64 (x64GenContext, X86_REG_RCX, X86_REG_RSP);
355
- x64Gen_mov_reg64_imm64 (x64GenContext, X86_REG_RDX, gprIndex);
356
- // restore stackpointer to original RSP
357
- x64Emit_mov_reg64_mem64 (x64GenContext, X86_REG_RSP, REG_RESV_HCPU, offsetof (PPCInterpreter_t, rspTemp));
358
- // push hCPU on stack
359
- x64Gen_push_reg64 (x64GenContext, X86_REG_RCX);
360
- // reserve space on stack for call parameters
361
- x64Gen_sub_reg64_imm32 (x64GenContext, X86_REG_RSP, 8 *11 + 8 );
362
- x64Gen_mov_reg64_imm64 (x64GenContext, X86_REG_RBP, 0 );
363
- // call function
364
- if ( sprId == SPR_TBL )
365
- x64Gen_mov_reg64_imm64 (x64GenContext, X86_REG_RAX, (uint64)PPCRecompiler_getTBL);
366
- else if ( sprId == SPR_TBU )
367
- x64Gen_mov_reg64_imm64 (x64GenContext, X86_REG_RAX, (uint64)PPCRecompiler_getTBU);
368
- else
369
- assert_dbg ();
370
- x64Gen_call_reg64 (x64GenContext, X86_REG_RAX);
371
- // restore hCPU from stack
372
- x64Gen_add_reg64_imm32 (x64GenContext, X86_REG_RSP, 8 * 11 + 8 );
373
- x64Gen_pop_reg64 (x64GenContext, X86_REG_RSP);
374
- // MOV R15, ppcRecompilerInstanceData
375
- x64Gen_mov_reg64_imm64 (x64GenContext, X86_REG_R15, (uint64)ppcRecompilerInstanceData);
376
- // MOV R13, memory_base
377
- x64Gen_mov_reg64_imm64 (x64GenContext, X86_REG_R13, (uint64)memory_base);
378
- return true ;
379
- }
380
331
else
381
332
{
382
333
debug_printf (" Unknown recompiler macro operation %d\n " , imlInstruction->operation );
0 commit comments