IPU: Minor tweaks to casts and static vars while looking for potential GCC issues.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3584 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2010-07-31 14:29:59 +00:00
parent 844bfd297a
commit fa14e157c6
4 changed files with 13 additions and 24 deletions

View File

@ -926,7 +926,7 @@ u16 __fastcall FillInternalBuffer(u32 * pointer, u32 advance, u32 size)
inc_readbits(); inc_readbits();
g_BP.FP = 1; g_BP.FP = 1;
} }
if ((g_BP.FP < 2) && ((*(int*)pointer + size) >= 128)) if ((g_BP.FP < 2) && ((*(int*)pointer + size) >= 128))
{ {
if (ipu_fifo.in.read(next_readbits())) g_BP.FP += 1; if (ipu_fifo.in.read(next_readbits())) g_BP.FP += 1;
@ -954,7 +954,6 @@ u8 __fastcall getBits128(u8 *address, u32 advance)
{ {
u64 mask2; u64 mask2;
u128 mask; u128 mask;
u32 shift;
u8* readpos; u8* readpos;
// Check if the current BP has exceeded or reached the limit of 128 // Check if the current BP has exceeded or reached the limit of 128
@ -962,7 +961,7 @@ u8 __fastcall getBits128(u8 *address, u32 advance)
readpos = readbits + (int)g_BP.BP / 8; readpos = readbits + (int)g_BP.BP / 8;
if (g_BP.BP & 7) if (uint shift = (g_BP.BP & 7))
{ {
shift = g_BP.BP & 7; shift = g_BP.BP & 7;
mask2 = 0xff >> shift; mask2 = 0xff >> shift;
@ -999,17 +998,15 @@ u8 __fastcall getBits128(u8 *address, u32 advance)
u8 __fastcall getBits64(u8 *address, u32 advance) u8 __fastcall getBits64(u8 *address, u32 advance)
{ {
register u64 mask = 0; register u64 mask = 0;
int shift = 0;
u8* readpos; u8* readpos;
// Check if the current BP has exceeded or reached the limit of 128 // Check if the current BP has exceeded or reached the limit of 128
if (FillInternalBuffer(&g_BP.BP, 1, 64) < 64) return 0; if (FillInternalBuffer(&g_BP.BP, 1, 64) < 64) return 0;
readpos = readbits + (int)g_BP.BP / 8; readpos = readbits + (int)g_BP.BP / 8;
if (g_BP.BP & 7) if (uint shift = (g_BP.BP & 7))
{ {
shift = g_BP.BP & 7;
mask = (0xff >> shift); mask = (0xff >> shift);
mask = mask | (mask << 8) | (mask << 16) | (mask << 24) | (mask << 32) | (mask << 40) | (mask << 48) | (mask << 56); mask = mask | (mask << 8) | (mask << 16) | (mask << 24) | (mask << 32) | (mask << 40) | (mask << 48) | (mask << 56);
@ -1029,7 +1026,7 @@ u8 __fastcall getBits64(u8 *address, u32 advance)
// while the high bits come from the current byte // while the high bits come from the current byte
u8 __fastcall getBits32(u8 *address, u32 advance) u8 __fastcall getBits32(u8 *address, u32 advance)
{ {
register u32 mask, shift = 0; u32 mask;
u8* readpos; u8* readpos;
// Check if the current BP has exceeded or reached the limit of 128 // Check if the current BP has exceeded or reached the limit of 128
@ -1037,9 +1034,8 @@ u8 __fastcall getBits32(u8 *address, u32 advance)
readpos = readbits + (int)g_BP.BP / 8; readpos = readbits + (int)g_BP.BP / 8;
if (g_BP.BP & 7) if (uint shift = (g_BP.BP & 7))
{ {
shift = g_BP.BP & 7;
mask = (0xff >> shift); mask = (0xff >> shift);
mask = mask | (mask << 8) | (mask << 16) | (mask << 24); mask = mask | (mask << 8) | (mask << 16) | (mask << 24);
@ -1057,7 +1053,7 @@ u8 __fastcall getBits32(u8 *address, u32 advance)
__forceinline u8 __fastcall getBits16(u8 *address, u32 advance) __forceinline u8 __fastcall getBits16(u8 *address, u32 advance)
{ {
register u32 mask, shift = 0; u32 mask;
u8* readpos; u8* readpos;
// Check if the current BP has exceeded or reached the limit of 128 // Check if the current BP has exceeded or reached the limit of 128
@ -1065,7 +1061,7 @@ __forceinline u8 __fastcall getBits16(u8 *address, u32 advance)
readpos = readbits + (int)g_BP.BP / 8; readpos = readbits + (int)g_BP.BP / 8;
if (g_BP.BP & 7) if (uint shift = (g_BP.BP & 7))
{ {
shift = g_BP.BP & 7; shift = g_BP.BP & 7;
mask = (0xff >> shift); mask = (0xff >> shift);

View File

@ -19,7 +19,7 @@
#include "IPU_Fifo.h" #include "IPU_Fifo.h"
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma pack(1) //#pragma pack(1)
#endif #endif
#define ipumsk( src ) ( (src) & 0xff ) #define ipumsk( src ) ( (src) & 0xff )
@ -112,7 +112,7 @@ struct tIPU_BP {
}; };
#ifdef _WIN32 #ifdef _WIN32
#pragma pack() //#pragma pack()
#endif #endif
union tIPU_CMD_IDEC union tIPU_CMD_IDEC

View File

@ -192,10 +192,6 @@ static __forceinline int get_coded_block_pattern()
int __forceinline get_motion_delta(const int f_code) int __forceinline get_motion_delta(const int f_code)
{ {
#define bit_buf (decoder.bitstream_buf)
#define bits (decoder.bitstream_bits)
#define bit_ptr (decoder.bitstream_ptr)
int delta; int delta;
int sign; int sign;
const MVtab * tab; const MVtab * tab;
@ -221,10 +217,6 @@ int __forceinline get_motion_delta(const int f_code)
sign = SBITS(1); sign = SBITS(1);
DUMPBITS(1); DUMPBITS(1);
return (delta ^ sign) - sign; return (delta ^ sign) - sign;
#undef bit_buf
#undef bits
#undef bit_ptr
} }
int __forceinline get_dmv() int __forceinline get_dmv()

View File

@ -30,13 +30,14 @@
#ifndef __VLC_H__ #ifndef __VLC_H__
#define __VLC_H__ #define __VLC_H__
static u8 data[2];
//static u8 word[4]; //static u8 word[4];
//static u8 dword[8]; //static u8 dword[8];
//static u8 qword[16]; //static u8 qword[16];
static __forceinline int GETWORD() static __forceinline int GETWORD()
{ {
static u8 data[2];
if (decoder.bitstream_bits > 0) if (decoder.bitstream_bits > 0)
{ {
if(!getBits16(data,1)) if(!getBits16(data,1))
@ -48,7 +49,7 @@ static __forceinline int GETWORD()
BigEndian(data, *(u32*)word); BigEndian(data, *(u32*)word);
decoder.bitstream_buf |= (u64)data << decoder.bitstream_bits; decoder.bitstream_buf |= (u64)data << decoder.bitstream_bits;
decoder.bitstream_bits -= 32;*/ decoder.bitstream_bits -= 32;*/
decoder.bitstream_buf |= ((u32)(((u16)data[0] << 8) | data[1])) << decoder.bitstream_bits; decoder.bitstream_buf |= (((u32)data[0] << 8) | data[1]) << decoder.bitstream_bits;
decoder.bitstream_bits -= 16; decoder.bitstream_bits -= 16;
} }