Fix various warnings reported by clang

- mostly remove unused variables
- rename some generic JIT identifiers
This commit is contained in:
Tillmann Karras 2014-02-23 15:14:27 +01:00
parent a3508823de
commit 6914eca167
17 changed files with 37 additions and 54 deletions

View File

@ -134,7 +134,7 @@ namespace AudioCommon
{
return true;
}
return SConfig::GetInstance().m_EnableJIT;
return SConfig::GetInstance().m_DSPEnableJIT;
}
void PauseAndLock(bool doLock, bool unpauseOnUnlock)

View File

@ -22,11 +22,6 @@ const char *filter = "0123456789ABCDEFGHJKMNPQRTUVWXYZILOS";
u32 genseeds[0x20];
const u8 bitstringlen[0x08] = {
0x06, 0x0A, 0x0C, 0x11, 0x11, 0x08, 0x07, 0x20,
};
const u8 gentable0[0x38] = {
0x39, 0x31, 0x29, 0x21, 0x19, 0x11, 0x09, 0x01,
0x3A, 0x32, 0x2A, 0x22, 0x1A, 0x12, 0x0A, 0x02,

View File

@ -109,7 +109,7 @@ bool BootCore(const std::string& _rFilename)
config_cache.bDSPHLE = StartUp.bDSPHLE;
config_cache.strBackend = StartUp.m_strVideoBackend;
config_cache.bHLE_BS2 = StartUp.bHLE_BS2;
config_cache.m_EnableJIT = SConfig::GetInstance().m_EnableJIT;
config_cache.m_EnableJIT = SConfig::GetInstance().m_DSPEnableJIT;
config_cache.bDSPThread = StartUp.bDSPThread;
config_cache.Volume = SConfig::GetInstance().m_Volume;
config_cache.sBackend = SConfig::GetInstance().sBackend;
@ -158,7 +158,7 @@ bool BootCore(const std::string& _rFilename)
}
if (game_ini.Get("DSP", "Volume", &SConfig::GetInstance().m_Volume, SConfig::GetInstance().m_Volume))
config_cache.bSetVolume = true;
game_ini.Get("DSP", "EnableJIT", &SConfig::GetInstance().m_EnableJIT, SConfig::GetInstance().m_EnableJIT);
game_ini.Get("DSP", "EnableJIT", &SConfig::GetInstance().m_DSPEnableJIT, SConfig::GetInstance().m_DSPEnableJIT);
game_ini.Get("DSP", "Backend", &SConfig::GetInstance().sBackend, SConfig::GetInstance().sBackend);
VideoBackend::ActivateBackend(StartUp.m_strVideoBackend);
@ -223,7 +223,7 @@ bool BootCore(const std::string& _rFilename)
StartUp.bDSPHLE = g_NetPlaySettings.m_DSPHLE;
StartUp.bEnableMemcardSaving = g_NetPlaySettings.m_WriteToMemcard;
StartUp.iCPUCore = g_NetPlaySettings.m_CPUcore;
SConfig::GetInstance().m_EnableJIT = g_NetPlaySettings.m_DSPEnableJIT;
SConfig::GetInstance().m_DSPEnableJIT = g_NetPlaySettings.m_DSPEnableJIT;
SConfig::GetInstance().m_EXIDevice[0] = g_NetPlaySettings.m_EXIDevice[0];
SConfig::GetInstance().m_EXIDevice[1] = g_NetPlaySettings.m_EXIDevice[1];
config_cache.bSetEXIDevice[0] = true;
@ -268,7 +268,7 @@ void Stop()
VideoBackend::ActivateBackend(StartUp.m_strVideoBackend);
StartUp.bHLE_BS2 = config_cache.bHLE_BS2;
SConfig::GetInstance().sBackend = config_cache.sBackend;
SConfig::GetInstance().m_EnableJIT = config_cache.m_EnableJIT;
SConfig::GetInstance().m_DSPEnableJIT = config_cache.m_EnableJIT;
// Only change these back if they were actually set by game ini, since they can be changed while a game is running.
if (config_cache.bSetFramelimit)

View File

@ -267,7 +267,7 @@ void SConfig::SaveSettings()
ini.Set("Movie", "Author", m_strMovieAuthor);
// DSP
ini.Set("DSP", "EnableJIT", m_EnableJIT);
ini.Set("DSP", "EnableJIT", m_DSPEnableJIT);
ini.Set("DSP", "DumpAudio", m_DumpAudio);
ini.Set("DSP", "Backend", sBackend);
ini.Set("DSP", "Volume", m_Volume);
@ -430,7 +430,7 @@ void SConfig::LoadSettings()
ini.Get("Movie", "Author", &m_strMovieAuthor, "");
// DSP
ini.Get("DSP", "EnableJIT", &m_EnableJIT, true);
ini.Get("DSP", "EnableJIT", &m_DSPEnableJIT, true);
ini.Get("DSP", "DumpAudio", &m_DumpAudio, false);
#if defined __linux__ && HAVE_ALSA
ini.Get("DSP", "Backend", &sBackend, BACKEND_ALSA);

View File

@ -79,7 +79,7 @@ struct SConfig : NonCopyable
unsigned int m_FrameSkip;
// DSP settings
bool m_EnableJIT;
bool m_DSPEnableJIT;
bool m_DumpAudio;
int m_Volume;
std::string sBackend;

View File

@ -296,7 +296,7 @@ restart:
{
PB.ReachedEnd = 0;
if ((PB.RepeatMode == 0) || (!PB.StopOnSilence == 0))
if ((PB.RepeatMode == 0) || (PB.StopOnSilence != 0))
{
PB.KeyOff = 1;
PB.RemLength = 0;

View File

@ -10,8 +10,8 @@ namespace WiimoteEmu
// Extension device IDs to be written to the last bytes of the extension reg
// The id for nothing inserted
static const u8 nothing_id[] = { 0x00, 0x00, 0x00, 0x00, 0x2e, 0x2e };
// The id for a partially inserted extension
static const u8 partially_id[] = { 0x00, 0x00, 0x00, 0x00, 0xff, 0xff };
// The id for a partially inserted extension (currently unused)
//static const u8 partially_id[] = { 0x00, 0x00, 0x00, 0x00, 0xff, 0xff };
Attachment::Attachment( const char* const _name, WiimoteEmu::ExtensionReg& _reg )
: name( _name ), reg( _reg )

View File

@ -10,7 +10,6 @@
static const u64 GC_ALIGNED16(psSignBits2[2]) = {0x8000000000000000ULL, 0x8000000000000000ULL};
static const u64 GC_ALIGNED16(psAbsMask2[2]) = {0x7FFFFFFFFFFFFFFFULL, 0x7FFFFFFFFFFFFFFFULL};
static const double GC_ALIGNED16(psOneOne2[2]) = {1.0, 1.0};
static const double one_const = 1.0f;
void Jit64::fp_tri_op(int d, int a, int b, bool reversible, bool single, void (XEmitter::*op)(Gen::X64Reg, Gen::OpArg))

View File

@ -16,10 +16,8 @@ namespace {
// pshufb todo: MOVQ
const u8 GC_ALIGNED16(bswapShuffle1x4[16]) = {3, 2, 1, 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
const u8 GC_ALIGNED16(bswapShuffle2x4[16]) = {3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11, 12, 13, 14, 15};
const u8 GC_ALIGNED16(bswapShuffle1x8[16]) = {7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15};
const u8 GC_ALIGNED16(bswapShuffle1x8Dupe[16]) = {7, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0};
const u8 GC_ALIGNED16(bswapShuffle2x8[16]) = {7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8};
u64 GC_ALIGNED16(temp64);

View File

@ -12,8 +12,6 @@
#include "Core/PowerPC/Jit64/JitAsm.h"
#include "Core/PowerPC/Jit64/JitRegCache.h"
const u8 GC_ALIGNED16(pbswapShuffle2x4[16]) = {3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11, 12, 13, 14, 15};
// The big problem is likely instructions that set the quantizers in the same block.
// We will have to break block after quantizers are written to.
void Jit64::psq_st(UGeckoInstruction inst)

View File

@ -14,10 +14,9 @@
namespace DiscIO
{
const u64 wii_sector_size = 0x8000;
const u64 wii_sector_count = 143432 * 2;
const u64 wii_sector_log2 = 15;
const u64 wii_disc_header_size = 256;
static const u64 wii_sector_size = 0x8000;
static const u64 wii_sector_count = 143432 * 2;
static const u64 wii_disc_header_size = 256;
static inline u64 align(u64 value, u64 bounds)
{

View File

@ -368,7 +368,7 @@ void CConfigMain::InitializeGUIValues()
if (startup_params.bDSPHLE)
DSPEngine->SetSelection(0);
else
DSPEngine->SetSelection(SConfig::GetInstance().m_EnableJIT ? 1 : 2);
DSPEngine->SetSelection(SConfig::GetInstance().m_DSPEnableJIT ? 1 : 2);
// Audio
VolumeSlider->Enable(SupportsVolumeChanges(SConfig::GetInstance().sBackend));
@ -957,8 +957,7 @@ void CConfigMain::AudioSettingsChanged(wxCommandEvent& event)
{
case ID_DSPENGINE:
SConfig::GetInstance().m_LocalCoreStartupParameter.bDSPHLE = DSPEngine->GetSelection() == 0;
if (!DSPEngine->GetSelection() == 0)
SConfig::GetInstance().m_EnableJIT = DSPEngine->GetSelection() == 1;
SConfig::GetInstance().m_DSPEnableJIT = DSPEngine->GetSelection() == 1;
AudioCommon::UpdateSoundStream();
break;

View File

@ -442,7 +442,7 @@ void NetPlayDiag::GetNetSettings(NetSettings &settings)
settings.m_CPUthread = instance.m_LocalCoreStartupParameter.bCPUThread;
settings.m_CPUcore = instance.m_LocalCoreStartupParameter.iCPUCore;
settings.m_DSPHLE = instance.m_LocalCoreStartupParameter.bDSPHLE;
settings.m_DSPEnableJIT = instance.m_EnableJIT;
settings.m_DSPEnableJIT = instance.m_DSPEnableJIT;
settings.m_WriteToMemcard = m_memcard_write->GetValue();
settings.m_EXIDevice[0] = instance.m_EXIDevice[0];
settings.m_EXIDevice[1] = instance.m_EXIDevice[1];

View File

@ -14,7 +14,6 @@
#include "VideoCommon/VertexShaderManager.h"
#include "VideoCommon/VideoConfig.h"
const bool renderFog = false;
namespace BPFunctions
{
// ----------------------------------------------

View File

@ -177,13 +177,6 @@ int TexDecoder_GetPaletteSize(int format)
}
}
static inline u32 decodeIA8(u16 val)
{
int a = val >> 8;
int i = val & 0xFF;
return (a << 24) | (i << 16) | (i << 8) | i;
}
static inline u32 decode5A3(u16 val)
{
int r,g,b,a;

View File

@ -28,11 +28,6 @@
//BBox
#include "VideoCommon/XFMemory.h"
#ifndef _M_GENERIC
#ifndef __APPLE__
#define USE_JIT
#endif
#endif
#define COMPILED_CODE_SIZE 4096
@ -472,7 +467,6 @@ VertexLoader::VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr)
m_compiledCode = NULL;
m_numLoadedVertices = 0;
m_VertexSize = 0;
m_numPipelineStages = 0;
m_NativeFmt = 0;
loop_counter = 0;
VertexLoader_Normal::Init();
@ -482,11 +476,12 @@ VertexLoader::VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr)
m_VtxDesc = vtx_desc;
SetVAT(vtx_attr.g0.Hex, vtx_attr.g1.Hex, vtx_attr.g2.Hex);
#ifdef USE_JIT
#ifdef USE_VERTEX_LOADER_JIT
AllocCodeSpace(COMPILED_CODE_SIZE);
CompileVertexTranslator();
WriteProtect();
#else
m_numPipelineStages = 0;
CompileVertexTranslator();
#endif
@ -494,7 +489,7 @@ VertexLoader::VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr)
VertexLoader::~VertexLoader()
{
#ifdef USE_JIT
#ifdef USE_VERTEX_LOADER_JIT
FreeCodeSpace();
#endif
delete m_NativeFmt;
@ -505,7 +500,7 @@ void VertexLoader::CompileVertexTranslator()
m_VertexSize = 0;
const TVtxAttr &vtx_attr = m_VtxAttr;
#ifdef USE_JIT
#ifdef USE_VERTEX_LOADER_JIT
if (m_compiledCode)
PanicAlert("Trying to recompile a vertex translator");
@ -531,6 +526,9 @@ void VertexLoader::CompileVertexTranslator()
WriteSetVariable(32, &s_texmtxwrite, Imm32(0));
WriteSetVariable(32, &s_texmtxread, Imm32(0));
}
#else
// Reset pipeline
m_numPipelineStages = 0;
#endif
// Colors
@ -544,8 +542,6 @@ void VertexLoader::CompileVertexTranslator()
m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, (const u32)((m_VtxDesc.Hex >> 31) & 3)
};
// Reset pipeline
m_numPipelineStages = 0;
u32 components = 0;
// Position in pc vertex format.
@ -770,7 +766,7 @@ void VertexLoader::CompileVertexTranslator()
native_stride = nat_offset;
vtx_decl.stride = native_stride;
#ifdef USE_JIT
#ifdef USE_VERTEX_LOADER_JIT
// End loop here
#ifdef _M_X64
MOV(64, R(RAX), Imm64((u64)&loop_counter));
@ -790,7 +786,7 @@ void VertexLoader::CompileVertexTranslator()
void VertexLoader::WriteCall(TPipelineFunction func)
{
#ifdef USE_JIT
#ifdef USE_VERTEX_LOADER_JIT
#ifdef _M_X64
MOV(64, R(RAX), Imm64((u64)func));
CALLptr(R(RAX));
@ -805,7 +801,7 @@ void VertexLoader::WriteCall(TPipelineFunction func)
#ifndef _M_GENERIC
void VertexLoader::WriteGetVariable(int bits, OpArg dest, void *address)
{
#ifdef USE_JIT
#ifdef USE_VERTEX_LOADER_JIT
#ifdef _M_X64
MOV(64, R(RAX), Imm64((u64)address));
MOV(bits, dest, MatR(RAX));
@ -817,7 +813,7 @@ void VertexLoader::WriteGetVariable(int bits, OpArg dest, void *address)
void VertexLoader::WriteSetVariable(int bits, void *address, OpArg value)
{
#ifdef USE_JIT
#ifdef USE_VERTEX_LOADER_JIT
#ifdef _M_X64
MOV(64, R(RAX), Imm64((u64)address));
MOV(bits, MatR(RAX), value);
@ -870,7 +866,7 @@ void VertexLoader::SetupRunVertices(int vtx_attr_group, int primitive, int const
void VertexLoader::ConvertVertices ( int count )
{
#ifdef USE_JIT
#ifdef USE_VERTEX_LOADER_JIT
if (count > 0)
{
loop_counter = count;

View File

@ -17,6 +17,11 @@
#include "VideoCommon/DataReader.h"
#include "VideoCommon/NativeVertexFormat.h"
#ifndef _M_GENERIC
#ifndef __APPLE__
#define USE_VERTEX_LOADER_JIT
#endif
#endif
class VertexLoaderUID
{
@ -119,9 +124,11 @@ private:
NativeVertexFormat *m_NativeFmt;
int native_stride;
// Pipeline. To be JIT compiled in the future.
#ifndef USE_VERTEX_LOADER_JIT
// Pipeline.
TPipelineFunction m_PipelineStages[64]; // TODO - figure out real max. it's lower.
int m_numPipelineStages;
#endif
const u8 *m_compiledCode;