mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-02-19 19:30:42 +00:00
- Add possibility to skip a test category (ALU, FPU, VMX). This will only
generate target code without executing it, and not comparing results - Fix aligned_vector_t, we can't rely on THIS pointer to be 16-byte aligned - Also fix dummy_vector alignment
This commit is contained in:
parent
37ee682c0f
commit
92f7738f80
@ -88,6 +88,11 @@ typedef uintptr_t uintptr;
|
|||||||
#define TEST_VMX_OPS 1
|
#define TEST_VMX_OPS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Define units to skip during testing
|
||||||
|
#define SKIP_ALU_OPS 0
|
||||||
|
#define SKIP_FPU_OPS 0
|
||||||
|
#define SKIP_VMX_OPS 0
|
||||||
|
|
||||||
// Define instructions to test
|
// Define instructions to test
|
||||||
#define TEST_ADD 1
|
#define TEST_ADD 1
|
||||||
#define TEST_SUB 1
|
#define TEST_SUB 1
|
||||||
@ -511,7 +516,7 @@ public:
|
|||||||
aligned_vector_t(vector_t const & vi)
|
aligned_vector_t(vector_t const & vi)
|
||||||
{ memcpy(addr(), &vi, sizeof(vector_t)); }
|
{ memcpy(addr(), &vi, sizeof(vector_t)); }
|
||||||
vector_t *addr() const
|
vector_t *addr() const
|
||||||
{ return (vector_t *)((char *)&vs.v + (16 - (((char *)&vs.v - (char *)this) % 16))); }
|
{ return (vector_t *)(((char *)&vs.v) + (16 - (((uintptr)&vs.v) % 16))); }
|
||||||
vector_t const & value() const
|
vector_t const & value() const
|
||||||
{ return *addr(); }
|
{ return *addr(); }
|
||||||
vector_t & value()
|
vector_t & value()
|
||||||
@ -946,6 +951,9 @@ void powerpc_test_cpu::test_one_1(uint32 *code, const char *insn, uint32 a1, uin
|
|||||||
const uint32 native_cr = get32();
|
const uint32 native_cr = get32();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (SKIP_ALU_OPS)
|
||||||
|
return;
|
||||||
|
|
||||||
// Invoke emulated code
|
// Invoke emulated code
|
||||||
emul_set_xer(init_xer);
|
emul_set_xer(init_xer);
|
||||||
emul_set_cr(init_cr);
|
emul_set_cr(init_cr);
|
||||||
@ -1594,10 +1602,10 @@ void powerpc_test_cpu::test_one_vector(uint32 *code, vector_test_t const & vt, u
|
|||||||
memset(&native_vD, 0, sizeof(native_vD));
|
memset(&native_vD, 0, sizeof(native_vD));
|
||||||
static vector_helper_t native_vSCR;
|
static vector_helper_t native_vSCR;
|
||||||
memset(&native_vSCR, 0, sizeof(native_vSCR));
|
memset(&native_vSCR, 0, sizeof(native_vSCR));
|
||||||
static vector_t dummy_vector;
|
static aligned_vector_t dummy_vector;
|
||||||
if (!rAp) rAp = dummy_vector;
|
if (!rAp) rAp = (uint8 *)dummy_vector.addr();
|
||||||
if (!rBp) rBp = dummy_vector;
|
if (!rBp) rBp = (uint8 *)dummy_vector.addr();
|
||||||
if (!rCp) rCp = dummy_vector;
|
if (!rCp) rCp = (uint8 *)dummy_vector.addr();
|
||||||
#ifdef NATIVE_POWERPC
|
#ifdef NATIVE_POWERPC
|
||||||
// Invoke native code
|
// Invoke native code
|
||||||
const uint32 save_cr = native_get_cr();
|
const uint32 save_cr = native_get_cr();
|
||||||
@ -1620,6 +1628,9 @@ void powerpc_test_cpu::test_one_vector(uint32 *code, vector_test_t const & vt, u
|
|||||||
const uint32 native_vscr = get32();
|
const uint32 native_vscr = get32();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (SKIP_VMX_OPS)
|
||||||
|
return;
|
||||||
|
|
||||||
// Invoke emulated code
|
// Invoke emulated code
|
||||||
static aligned_vector_t emul_vD;
|
static aligned_vector_t emul_vD;
|
||||||
memset(emul_vD.addr(), 0, sizeof(vector_t));
|
memset(emul_vD.addr(), 0, sizeof(vector_t));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user