mirror of https://github.com/PCSX2/pcsx2.git
GregMiscellaneous: zzogl-pg: Move the time functions over to be by the Profile code.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/GregMiscellaneous@3999 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
0970117f81
commit
7501916896
|
@ -35,6 +35,23 @@ extern u64 luPerfFreq;
|
||||||
#ifdef __LINUX__
|
#ifdef __LINUX__
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <sys/timeb.h> // ftime(), struct timeb
|
||||||
|
|
||||||
|
inline unsigned long timeGetTime()
|
||||||
|
{
|
||||||
|
timeb t;
|
||||||
|
ftime(&t);
|
||||||
|
|
||||||
|
return (unsigned long)(t.time*1000 + t.millitm);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline unsigned long timeGetPreciseTime()
|
||||||
|
{
|
||||||
|
timespec t;
|
||||||
|
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t);
|
||||||
|
|
||||||
|
return t.tv_nsec;
|
||||||
|
}
|
||||||
|
|
||||||
static __forceinline void InitCPUTicks()
|
static __forceinline void InitCPUTicks()
|
||||||
{
|
{
|
||||||
|
@ -56,6 +73,18 @@ static __forceinline u64 GetCPUTicks()
|
||||||
#else
|
#else
|
||||||
static __aligned16 LARGE_INTEGER lfreq;
|
static __aligned16 LARGE_INTEGER lfreq;
|
||||||
|
|
||||||
|
inline unsigned long timeGetTime()
|
||||||
|
{
|
||||||
|
// Implement later.
|
||||||
|
return (unsigned long)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline unsigned long timeGetPreciseTime()
|
||||||
|
{
|
||||||
|
// Implement later.
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static __forceinline void InitCPUTicks()
|
static __forceinline void InitCPUTicks()
|
||||||
{
|
{
|
||||||
QueryPerformanceFrequency(&lfreq);
|
QueryPerformanceFrequency(&lfreq);
|
||||||
|
|
|
@ -53,6 +53,7 @@ extern "C" u32 CALLBACK PS2EgetLibVersion2(u32 type);
|
||||||
extern "C" char* CALLBACK PS2EgetLibName(void);
|
extern "C" char* CALLBACK PS2EgetLibName(void);
|
||||||
|
|
||||||
#include "ZZoglMath.h"
|
#include "ZZoglMath.h"
|
||||||
|
#include "Profile.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -90,34 +91,6 @@ static __forceinline void pcsx2_aligned_free(void* pmem)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __LINUX__
|
|
||||||
#include <sys/timeb.h> // ftime(), struct timeb
|
|
||||||
|
|
||||||
inline unsigned long timeGetTime()
|
|
||||||
{
|
|
||||||
timeb t;
|
|
||||||
ftime(&t);
|
|
||||||
|
|
||||||
return (unsigned long)(t.time*1000 + t.millitm);
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <time.h>
|
|
||||||
inline unsigned long timeGetPreciseTime()
|
|
||||||
{
|
|
||||||
timespec t;
|
|
||||||
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t);
|
|
||||||
|
|
||||||
return t.tv_nsec;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct RECT
|
|
||||||
{
|
|
||||||
int left, top;
|
|
||||||
int right, bottom;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
|
|
||||||
|
|
|
@ -2737,16 +2737,16 @@ void FlushTransferRanges(const tex0Info* ptex)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __LINUX__
|
||||||
//#define LOG_RESOLVE_PROFILE
|
//#define LOG_RESOLVE_PROFILE
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename Tdst, bool do_conversion>
|
template <typename Tdst, bool do_conversion>
|
||||||
inline void Resolve_32_Bit(const void* psrc, int fbp, int fbw, int fbh, const int psm, u32 fbm)
|
inline void Resolve_32_Bit(const void* psrc, int fbp, int fbw, int fbh, const int psm, u32 fbm)
|
||||||
{
|
{
|
||||||
u32 mask, imask;
|
u32 mask, imask;
|
||||||
#ifdef LOG_RESOLVE_PROFILE
|
#ifdef LOG_RESOLVE_PROFILE
|
||||||
#ifdef __LINUX__
|
|
||||||
u32 startime = timeGetPreciseTime();
|
u32 startime = timeGetPreciseTime();
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (PSMT_ISHALF(psm)) /* 16 bit */
|
if (PSMT_ISHALF(psm)) /* 16 bit */
|
||||||
|
@ -2822,10 +2822,8 @@ inline void Resolve_32_Bit(const void* psrc, int fbp, int fbw, int fbh, const in
|
||||||
src -= raw_size;
|
src -= raw_size;
|
||||||
}
|
}
|
||||||
#ifdef LOG_RESOLVE_PROFILE
|
#ifdef LOG_RESOLVE_PROFILE
|
||||||
#ifdef __LINUX__
|
|
||||||
ZZLog::Dev_Log("*** 32 bits: execution time %d", timeGetPreciseTime()-startime);
|
ZZLog::Dev_Log("*** 32 bits: execution time %d", timeGetPreciseTime()-startime);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const __aligned16 unsigned int pixel_5b_mask[4] = {0x0000001F, 0x0000001F, 0x0000001F, 0x0000001F};
|
static const __aligned16 unsigned int pixel_5b_mask[4] = {0x0000001F, 0x0000001F, 0x0000001F, 0x0000001F};
|
||||||
|
@ -3061,9 +3059,7 @@ void Resolve_32_Bit_sse2(const void* psrc, int fbp, int fbw, int fbh, u32 fbm)
|
||||||
{
|
{
|
||||||
// Note a basic implementation was done in Resolve_32_Bit function
|
// Note a basic implementation was done in Resolve_32_Bit function
|
||||||
#ifdef LOG_RESOLVE_PROFILE
|
#ifdef LOG_RESOLVE_PROFILE
|
||||||
#ifdef __LINUX__
|
|
||||||
u32 startime = timeGetPreciseTime();
|
u32 startime = timeGetPreciseTime();
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
u32 pix_mask;
|
u32 pix_mask;
|
||||||
if (PSMT_ISHALF(psm)) /* 16 bit format */
|
if (PSMT_ISHALF(psm)) /* 16 bit format */
|
||||||
|
@ -3137,10 +3133,8 @@ void Resolve_32_Bit_sse2(const void* psrc, int fbp, int fbw, int fbh, u32 fbm)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LOG_RESOLVE_PROFILE
|
#ifdef LOG_RESOLVE_PROFILE
|
||||||
#ifdef __LINUX__
|
|
||||||
ZZLog::Dev_Log("*** 32 bits: execution time %d", timeGetPreciseTime()-startime);
|
ZZLog::Dev_Log("*** 32 bits: execution time %d", timeGetPreciseTime()-startime);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue