mirror of https://github.com/PCSX2/pcsx2.git
Remove deprecated jASSUME from pcsx2 core. It is still used in some plugins
This commit is contained in:
parent
1facc8efbc
commit
7568f6f2ec
|
@ -68,7 +68,7 @@ void rcntReset(int index) {
|
||||||
static __fi void _rcntSet( int cntidx )
|
static __fi void _rcntSet( int cntidx )
|
||||||
{
|
{
|
||||||
s32 c;
|
s32 c;
|
||||||
jASSUME( cntidx <= 4 ); // rcntSet isn't valid for h/vsync counters.
|
pxAssume( cntidx <= 4 ); // rcntSet isn't valid for h/vsync counters.
|
||||||
|
|
||||||
const Counter& counter = counters[cntidx];
|
const Counter& counter = counters[cntidx];
|
||||||
|
|
||||||
|
|
|
@ -542,7 +542,7 @@ __fi void psxRcntWmode16( int index, u32 value )
|
||||||
{
|
{
|
||||||
PSXCNT_LOG( "IOP Counter[%d] writeMode = 0x%04X", index, value );
|
PSXCNT_LOG( "IOP Counter[%d] writeMode = 0x%04X", index, value );
|
||||||
|
|
||||||
jASSUME( index >= 0 && index < 3 );
|
pxAssume( index >= 0 && index < 3 );
|
||||||
psxCounter& counter = psxCounters[index];
|
psxCounter& counter = psxCounters[index];
|
||||||
|
|
||||||
counter.mode = value;
|
counter.mode = value;
|
||||||
|
@ -603,7 +603,7 @@ __fi void psxRcntWmode32( int index, u32 value )
|
||||||
{
|
{
|
||||||
PSXCNT_LOG( "IOP Counter[%d] writeMode = 0x%04x", index, value );
|
PSXCNT_LOG( "IOP Counter[%d] writeMode = 0x%04x", index, value );
|
||||||
|
|
||||||
jASSUME( index >= 3 && index < 6 );
|
pxAssume( index >= 3 && index < 6 );
|
||||||
psxCounter& counter = psxCounters[index];
|
psxCounter& counter = psxCounters[index];
|
||||||
|
|
||||||
counter.mode = value;
|
counter.mode = value;
|
||||||
|
|
|
@ -261,7 +261,7 @@ __fi void cpuSetEvent()
|
||||||
|
|
||||||
__fi void cpuClearInt( uint i )
|
__fi void cpuClearInt( uint i )
|
||||||
{
|
{
|
||||||
jASSUME( i < 32 );
|
pxAssume( i < 32 );
|
||||||
cpuRegs.interrupt &= ~(1 << i);
|
cpuRegs.interrupt &= ~(1 << i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ using namespace Internal;
|
||||||
mem8_t __fastcall iopHwRead8_Page1( u32 addr )
|
mem8_t __fastcall iopHwRead8_Page1( u32 addr )
|
||||||
{
|
{
|
||||||
// all addresses are assumed to be prefixed with 0x1f801xxx:
|
// all addresses are assumed to be prefixed with 0x1f801xxx:
|
||||||
jASSUME( (addr >> 12) == 0x1f801 );
|
pxAssume( (addr >> 12) == 0x1f801 );
|
||||||
|
|
||||||
u32 masked_addr = addr & 0x0fff;
|
u32 masked_addr = addr & 0x0fff;
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ mem8_t __fastcall iopHwRead8_Page1( u32 addr )
|
||||||
mem8_t __fastcall iopHwRead8_Page3( u32 addr )
|
mem8_t __fastcall iopHwRead8_Page3( u32 addr )
|
||||||
{
|
{
|
||||||
// all addresses are assumed to be prefixed with 0x1f803xxx:
|
// all addresses are assumed to be prefixed with 0x1f803xxx:
|
||||||
jASSUME( (addr >> 12) == 0x1f803 );
|
pxAssume( (addr >> 12) == 0x1f803 );
|
||||||
|
|
||||||
mem8_t ret;
|
mem8_t ret;
|
||||||
if( addr == 0x1f803100 ) // PS/EE/IOP conf related
|
if( addr == 0x1f803100 ) // PS/EE/IOP conf related
|
||||||
|
@ -98,7 +98,7 @@ mem8_t __fastcall iopHwRead8_Page3( u32 addr )
|
||||||
mem8_t __fastcall iopHwRead8_Page8( u32 addr )
|
mem8_t __fastcall iopHwRead8_Page8( u32 addr )
|
||||||
{
|
{
|
||||||
// all addresses are assumed to be prefixed with 0x1f808xxx:
|
// all addresses are assumed to be prefixed with 0x1f808xxx:
|
||||||
jASSUME( (addr >> 12) == 0x1f808 );
|
pxAssume( (addr >> 12) == 0x1f808 );
|
||||||
|
|
||||||
mem8_t ret;
|
mem8_t ret;
|
||||||
|
|
||||||
|
@ -117,10 +117,10 @@ template< typename T >
|
||||||
static __fi T _HwRead_16or32_Page1( u32 addr )
|
static __fi T _HwRead_16or32_Page1( u32 addr )
|
||||||
{
|
{
|
||||||
// all addresses are assumed to be prefixed with 0x1f801xxx:
|
// all addresses are assumed to be prefixed with 0x1f801xxx:
|
||||||
jASSUME( (addr >> 12) == 0x1f801 );
|
pxAssume( (addr >> 12) == 0x1f801 );
|
||||||
|
|
||||||
// all addresses should be aligned to the data operand size:
|
// all addresses should be aligned to the data operand size:
|
||||||
jASSUME(
|
pxAssume(
|
||||||
( sizeof(T) == 2 && (addr & 1) == 0 ) ||
|
( sizeof(T) == 2 && (addr & 1) == 0 ) ||
|
||||||
( sizeof(T) == 4 && (addr & 3) == 0 )
|
( sizeof(T) == 4 && (addr & 3) == 0 )
|
||||||
);
|
);
|
||||||
|
@ -385,7 +385,7 @@ mem16_t __fastcall iopHwRead16_Page1( u32 addr )
|
||||||
mem16_t __fastcall iopHwRead16_Page3( u32 addr )
|
mem16_t __fastcall iopHwRead16_Page3( u32 addr )
|
||||||
{
|
{
|
||||||
// all addresses are assumed to be prefixed with 0x1f803xxx:
|
// all addresses are assumed to be prefixed with 0x1f803xxx:
|
||||||
jASSUME( (addr >> 12) == 0x1f803 );
|
pxAssume( (addr >> 12) == 0x1f803 );
|
||||||
|
|
||||||
mem16_t ret = psxHu16(addr);
|
mem16_t ret = psxHu16(addr);
|
||||||
IopHwTraceLog<mem16_t>( addr, ret, true );
|
IopHwTraceLog<mem16_t>( addr, ret, true );
|
||||||
|
@ -397,7 +397,7 @@ mem16_t __fastcall iopHwRead16_Page3( u32 addr )
|
||||||
mem16_t __fastcall iopHwRead16_Page8( u32 addr )
|
mem16_t __fastcall iopHwRead16_Page8( u32 addr )
|
||||||
{
|
{
|
||||||
// all addresses are assumed to be prefixed with 0x1f808xxx:
|
// all addresses are assumed to be prefixed with 0x1f808xxx:
|
||||||
jASSUME( (addr >> 12) == 0x1f808 );
|
pxAssume( (addr >> 12) == 0x1f808 );
|
||||||
|
|
||||||
mem16_t ret = psxHu16(addr);
|
mem16_t ret = psxHu16(addr);
|
||||||
IopHwTraceLog<mem16_t>( addr, ret, true );
|
IopHwTraceLog<mem16_t>( addr, ret, true );
|
||||||
|
@ -416,7 +416,7 @@ mem32_t __fastcall iopHwRead32_Page1( u32 addr )
|
||||||
mem32_t __fastcall iopHwRead32_Page3( u32 addr )
|
mem32_t __fastcall iopHwRead32_Page3( u32 addr )
|
||||||
{
|
{
|
||||||
// all addresses are assumed to be prefixed with 0x1f803xxx:
|
// all addresses are assumed to be prefixed with 0x1f803xxx:
|
||||||
jASSUME( (addr >> 12) == 0x1f803 );
|
pxAssume( (addr >> 12) == 0x1f803 );
|
||||||
const mem32_t ret = psxHu32(addr);
|
const mem32_t ret = psxHu32(addr);
|
||||||
IopHwTraceLog<mem32_t>( addr, ret, true );
|
IopHwTraceLog<mem32_t>( addr, ret, true );
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -427,7 +427,7 @@ mem32_t __fastcall iopHwRead32_Page3( u32 addr )
|
||||||
mem32_t __fastcall iopHwRead32_Page8( u32 addr )
|
mem32_t __fastcall iopHwRead32_Page8( u32 addr )
|
||||||
{
|
{
|
||||||
// all addresses are assumed to be prefixed with 0x1f808xxx:
|
// all addresses are assumed to be prefixed with 0x1f808xxx:
|
||||||
jASSUME( (addr >> 12) == 0x1f808 );
|
pxAssume( (addr >> 12) == 0x1f808 );
|
||||||
|
|
||||||
u32 masked_addr = addr & 0x0fff;
|
u32 masked_addr = addr & 0x0fff;
|
||||||
mem32_t ret;
|
mem32_t ret;
|
||||||
|
|
|
@ -105,7 +105,7 @@ void SetFastMemory(int bSetFast)
|
||||||
//
|
//
|
||||||
void recLoad64( u32 bits, bool sign )
|
void recLoad64( u32 bits, bool sign )
|
||||||
{
|
{
|
||||||
jASSUME( bits == 64 || bits == 128 );
|
pxAssume( bits == 64 || bits == 128 );
|
||||||
|
|
||||||
// Load EDX with the destination.
|
// Load EDX with the destination.
|
||||||
// 64/128 bit modes load the result directly into the cpuRegs.GPR struct.
|
// 64/128 bit modes load the result directly into the cpuRegs.GPR struct.
|
||||||
|
@ -147,7 +147,7 @@ void recLoad64( u32 bits, bool sign )
|
||||||
//
|
//
|
||||||
void recLoad32( u32 bits, bool sign )
|
void recLoad32( u32 bits, bool sign )
|
||||||
{
|
{
|
||||||
jASSUME( bits <= 32 );
|
pxAssume( bits <= 32 );
|
||||||
|
|
||||||
// 8/16/32 bit modes return the loaded value in EAX.
|
// 8/16/32 bit modes return the loaded value in EAX.
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,7 @@ void vtlb_dynarec_init()
|
||||||
// Dynarec Load Implementations
|
// Dynarec Load Implementations
|
||||||
void vtlb_DynGenRead64(u32 bits)
|
void vtlb_DynGenRead64(u32 bits)
|
||||||
{
|
{
|
||||||
jASSUME( bits == 64 || bits == 128 );
|
pxAssume( bits == 64 || bits == 128 );
|
||||||
|
|
||||||
uptr* writeback = DynGen_PrepRegs();
|
uptr* writeback = DynGen_PrepRegs();
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ void vtlb_DynGenRead64(u32 bits)
|
||||||
// Returns read value in eax.
|
// Returns read value in eax.
|
||||||
void vtlb_DynGenRead32(u32 bits, bool sign)
|
void vtlb_DynGenRead32(u32 bits, bool sign)
|
||||||
{
|
{
|
||||||
jASSUME( bits <= 32 );
|
pxAssume( bits <= 32 );
|
||||||
|
|
||||||
uptr* writeback = DynGen_PrepRegs();
|
uptr* writeback = DynGen_PrepRegs();
|
||||||
|
|
||||||
|
|
|
@ -204,7 +204,7 @@ using namespace std;
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#define __forceinline __inline__ __attribute__((always_inline,unused))
|
#define __forceinline __inline__ __attribute__((always_inline,unused))
|
||||||
// #define __forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
// #define __forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||||
#define __assume(c) ((void)0)
|
#define __assume(c) if (!(c)) __builtin_unreachable()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -32,25 +32,10 @@
|
||||||
#define CALLBACK __stdcall
|
#define CALLBACK __stdcall
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
// jASSUME - give hints to the optimizer
|
#define UNREACHABLE_CODE __assume(0)
|
||||||
// This is primarily useful for the default case switch optimizer, which enables VC to
|
|
||||||
// generate more compact switches.
|
|
||||||
|
|
||||||
#ifdef NDEBUG
|
|
||||||
# define jBREAKPOINT() ((void) 0)
|
|
||||||
# ifdef _MSC_VER
|
|
||||||
# define jASSUME(exp) (__assume(exp))
|
|
||||||
# else
|
|
||||||
# define jASSUME(exp) ((void) sizeof(exp))
|
|
||||||
# endif
|
|
||||||
#else
|
#else
|
||||||
# if defined(_MSC_VER)
|
#define UNREACHABLE_CODE __builtin_unreachable()
|
||||||
# define jBREAKPOINT() do { __asm int 3 } while(0)
|
|
||||||
# else
|
|
||||||
# define jBREAKPOINT() ((void) *(volatile char *) 0)
|
|
||||||
# endif
|
|
||||||
# define jASSUME(exp) if(exp) ; else jBREAKPOINT()
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// disable the default case in a switch
|
// disable the default case in a switch
|
||||||
|
@ -59,7 +44,7 @@
|
||||||
break; \
|
break; \
|
||||||
\
|
\
|
||||||
default: \
|
default: \
|
||||||
jASSUME(0); \
|
UNREACHABLE_CODE; \
|
||||||
break; \
|
break; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue