Fix compilation on GCC and other Linux fixes (#80)

This commit is contained in:
Tom Lally 2022-08-28 14:29:15 +01:00 committed by GitHub
parent 96dcc7c82e
commit 454b587e36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 339 additions and 292 deletions

View file

@ -417,7 +417,7 @@ fs::path Account::GetFileName(uint32 persistent_id)
if (persistent_id < kMinPersistendId)
throw std::invalid_argument(fmt::format("persistent id {:#x} is invalid", persistent_id));
return CemuApp::GetMLCPath(fmt::format(L"usr\\save\\system\\act\\{:08x}\\account.dat", persistent_id)).ToStdWstring();
return CemuApp::GetMLCPath(fmt::format(L"usr/save/system/act/{:08x}/account.dat", persistent_id)).ToStdWstring();
}
OnlineValidator Account::ValidateOnlineFiles() const

View file

@ -1,6 +1,11 @@
project(CemuCafe)
include_directories(".")
if((CMAKE_C_COMPILER_ID STREQUAL "GNU") OR (CMAKE_C_COMPILER_ID STREQUAL "Clang"))
add_compile_options(-mssse3 -mavx2)
endif()
file(GLOB_RECURSE CPP_FILES *.cpp)
file(GLOB_RECURSE H_FILES *.h)
add_library(CemuCafe ${CPP_FILES} ${H_FILES})
@ -23,7 +28,6 @@ target_link_libraries(CemuCafe glslang SPIRV)
target_link_libraries(CemuCafe ih264d zarchive)
#target_link_libraries(CemuCafe zstd::libzstd_static)
IF(WIN32)
target_link_libraries(CemuCafe iphlpapi)
ENDIF()

View file

@ -34,7 +34,7 @@ PPCInterpreter_t* PPCInterpreter_getCurrentInstance()
return ppcInterpreterCurrentInstance;
}
__declspec(noinline) uint64 PPCInterpreter_getMainCoreCycleCounter()
uint64 PPCInterpreter_getMainCoreCycleCounter()
{
return PPCTimer_getFromRDTSC();
}

View file

@ -5,13 +5,6 @@
#include "util/helpers/fspinlock.h"
#include "util/highresolutiontimer/HighResolutionTimer.h"
#if BOOST_OS_LINUX || BOOST_OS_MACOS
static __inline__
unsigned __int64 _umul128(unsigned __int64,
unsigned __int64,
unsigned __int64*);
#endif
uint64 _rdtscLastMeasure = 0;
uint64 _rdtscFrequency = 0;
@ -49,7 +42,7 @@ uint64 PPCTimer_estimateRDTSCFrequency()
forceLog_printf("Invariant TSC not supported");
_mm_mfence();
unsigned __int64 tscStart = __rdtsc();
uint64 tscStart = __rdtsc();
unsigned int startTime = GetTickCount();
HRTick startTick = HighResolutionTimer::now().getTick();
// wait roughly 3 seconds
@ -61,7 +54,7 @@ uint64 PPCTimer_estimateRDTSCFrequency()
}
_mm_mfence();
HRTick stopTick = HighResolutionTimer::now().getTick();
unsigned __int64 tscEnd = __rdtsc();
uint64 tscEnd = __rdtsc();
// derive frequency approximation from measured time difference
uint64 tsc_diff = tscEnd - tscStart;
uint64 hrtFreq = 0;

View file

@ -345,20 +345,20 @@ typedef struct
PPCRecFunction_t* ppcRecompilerFuncTable[PPC_REC_ALIGN_TO_4MB(PPC_REC_CODE_AREA_SIZE/4)]; // one virtual-function pointer for each potential ppc instruction
PPCREC_JUMP_ENTRY ppcRecompilerDirectJumpTable[PPC_REC_ALIGN_TO_4MB(PPC_REC_CODE_AREA_SIZE/4)]; // lookup table for ppc offset to native code function
// x64 data
uint64 __declspec(align(16)) _x64XMM_xorNegateMaskBottom[2];
uint64 __declspec(align(16)) _x64XMM_xorNegateMaskPair[2];
uint64 __declspec(align(16)) _x64XMM_xorNOTMask[2];
uint64 __declspec(align(16)) _x64XMM_andAbsMaskBottom[2];
uint64 __declspec(align(16)) _x64XMM_andAbsMaskPair[2];
uint32 __declspec(align(16)) _x64XMM_andFloatAbsMaskBottom[4];
uint64 __declspec(align(16)) _x64XMM_singleWordMask[2];
double __declspec(align(16)) _x64XMM_constDouble1_1[2];
double __declspec(align(16)) _x64XMM_constDouble0_0[2];
float __declspec(align(16)) _x64XMM_constFloat0_0[2];
float __declspec(align(16)) _x64XMM_constFloat1_1[2];
float __declspec(align(16)) _x64XMM_constFloatMin[2];
uint32 __declspec(align(16)) _x64XMM_flushDenormalMask1[4];
uint32 __declspec(align(16)) _x64XMM_flushDenormalMaskResetSignBits[4];
alignas(16) uint64 _x64XMM_xorNegateMaskBottom[2];
alignas(16) uint64 _x64XMM_xorNegateMaskPair[2];
alignas(16) uint64 _x64XMM_xorNOTMask[2];
alignas(16) uint64 _x64XMM_andAbsMaskBottom[2];
alignas(16) uint64 _x64XMM_andAbsMaskPair[2];
alignas(16) uint32 _x64XMM_andFloatAbsMaskBottom[4];
alignas(16) uint64 _x64XMM_singleWordMask[2];
alignas(16) double _x64XMM_constDouble1_1[2];
alignas(16) double _x64XMM_constDouble0_0[2];
alignas(16) float _x64XMM_constFloat0_0[2];
alignas(16) float _x64XMM_constFloat1_1[2];
alignas(16) float _x64XMM_constFloatMin[2];
alignas(16) uint32 _x64XMM_flushDenormalMask1[4];
alignas(16) uint32 _x64XMM_flushDenormalMaskResetSignBits[4];
// PSQ load/store scale tables
double _psq_ld_scale_ps0_ps1[64 * 2];
double _psq_ld_scale_ps0_1[64 * 2];
@ -396,4 +396,4 @@ extern bool hasAVXSupport;
void PPCRecompiler_recompileIfUnvisited(uint32 enterAddress);
void PPCRecompiler_attemptEnter(struct PPCInterpreter_t* hCPU, uint32 enterAddress);
void PPCRecompiler_attemptEnterWithoutRecompile(struct PPCInterpreter_t* hCPU, uint32 enterAddress);
void PPCRecompiler_attemptEnterWithoutRecompile(struct PPCInterpreter_t* hCPU, uint32 enterAddress);

View file

@ -2221,7 +2221,10 @@ void PPCRecompilerX64Gen_imlInstruction_r_name(PPCRecFunction_t* PPCRecFunction,
else if (sprIndex == SPR_XER)
x64Emit_mov_reg64_mem32(x64GenContext, tempToRealRegister(imlInstruction->op_r_name.registerIndex), REG_RSP, offsetof(PPCInterpreter_t, spr.XER));
else if (sprIndex >= SPR_UGQR0 && sprIndex <= SPR_UGQR7)
x64Emit_mov_reg64_mem32(x64GenContext, tempToRealRegister(imlInstruction->op_r_name.registerIndex), REG_RSP, offsetof(PPCInterpreter_t, spr.UGQR[sprIndex - SPR_UGQR0]));
{
sint32 memOffset = offsetof(PPCInterpreter_t, spr.UGQR) + sizeof(PPCInterpreter_t::spr.UGQR[0]) * (sprIndex - SPR_UGQR0);
x64Emit_mov_reg64_mem32(x64GenContext, tempToRealRegister(imlInstruction->op_r_name.registerIndex), REG_RSP, memOffset);
}
else
assert_dbg();
//x64Emit_mov_reg64_mem32(x64GenContext, tempToRealRegister(imlInstruction->op_r_name.registerIndex), REG_RSP, offsetof(PPCInterpreter_t, spr)+sizeof(uint32)*(name-PPCREC_NAME_SPR0));
@ -2247,7 +2250,10 @@ void PPCRecompilerX64Gen_imlInstruction_name_r(PPCRecFunction_t* PPCRecFunction,
else if (sprIndex == SPR_XER)
x64Emit_mov_mem32_reg64(x64GenContext, REG_RSP, offsetof(PPCInterpreter_t, spr.XER), tempToRealRegister(imlInstruction->op_r_name.registerIndex));
else if (sprIndex >= SPR_UGQR0 && sprIndex <= SPR_UGQR7)
x64Emit_mov_mem32_reg64(x64GenContext, REG_RSP, offsetof(PPCInterpreter_t, spr.UGQR[sprIndex-SPR_UGQR0]), tempToRealRegister(imlInstruction->op_r_name.registerIndex));
{
sint32 memOffset = offsetof(PPCInterpreter_t, spr.UGQR) + sizeof(PPCInterpreter_t::spr.UGQR[0]) * (sprIndex - SPR_UGQR0);
x64Emit_mov_mem32_reg64(x64GenContext, REG_RSP, memOffset, tempToRealRegister(imlInstruction->op_r_name.registerIndex));
}
else
assert_dbg();
}

View file

@ -80,31 +80,31 @@ void LatteShader_calculateFSKey(LatteFetchShader* fetchShader)
{
LatteParsedFetchShaderAttribute_t* attrib = group.attrib + f;
key += (uint64)attrib->endianSwap;
key = _rotl64(key, 3);
key = std::rotl(key, 3);
key += (uint64)attrib->nfa;
key = _rotl64(key, 3);
key = std::rotl(key, 3);
key += (uint64)(attrib->isSigned?1:0);
key = _rotl64(key, 1);
key = std::rotl(key, 1);
key += (uint64)attrib->format;
key = _rotl64(key, 7);
key = std::rotl(key, 7);
key += (uint64)attrib->fetchType;
key = _rotl64(key, 8);
key = std::rotl(key, 8);
key += (uint64)attrib->ds[0];
key = _rotl64(key, 2);
key = std::rotl(key, 2);
key += (uint64)attrib->ds[1];
key = _rotl64(key, 2);
key = std::rotl(key, 2);
key += (uint64)attrib->ds[2];
key = _rotl64(key, 2);
key = std::rotl(key, 2);
key += (uint64)attrib->ds[3];
key = _rotl64(key, 2);
key = std::rotl(key, 2);
key += (uint64)(attrib->aluDivisor+1);
key = _rotl64(key, 2);
key = std::rotl(key, 2);
key += (uint64)attrib->attributeBufferIndex;
key = _rotl64(key, 8);
key = std::rotl(key, 8);
key += (uint64)attrib->semanticId;
key = _rotl64(key, 8);
key = std::rotl(key, 8);
key += (uint64)(attrib->offset & 3);
key = _rotl64(key, 2);
key = std::rotl(key, 2);
}
}
// todo - also hash invalid buffer groups?

View file

@ -743,7 +743,7 @@ private:
//h ^= *memU64;
//memU64++;
h = _rotr64(h, 7);
h = std::rotr(h, 7);
h += (*memU64 + (uint64)i);
memU64++;
}

View file

@ -518,7 +518,7 @@ void LatteOverlay_translateScreenPosition(ScreenPosition pos, const Vector2f& wi
direction = -1;
break;
default:
__assume(false);
UNREACHABLE;
}
}

View file

@ -158,15 +158,15 @@ void LatteMRT::ApplyCurrentState()
if (colorView)
{
key += ((uint64)colorView);
key = _rotl64(key, 5);
key = std::rotl(key, 5);
fboLookupView = colorView;
}
key = _rotl64(key, 7);
key = std::rotl(key, 7);
}
if (sLatteCurrentRendertargets.depthBuffer.view)
{
key += ((uint64)sLatteCurrentRendertargets.depthBuffer.view);
key = _rotl64(key, 5);
key = std::rotl(key, 5);
key += (sLatteCurrentRendertargets.depthBuffer.hasStencil);
if (fboLookupView == NULL)
{

View file

@ -225,8 +225,8 @@ void LatteShader_UpdatePSInputs(uint32* contextRegisters)
// parameter gen
if (spi0_paramGen != 0)
{
key += _rotr64(spi0_paramGen, 7);
key += _rotr64(spi0_paramGenAddr, 3);
key += std::rotr<uint64>(spi0_paramGen, 7);
key += std::rotr<uint64>(spi0_paramGenAddr, 3);
_activePSImportTable.paramGen = spi0_paramGen;
_activePSImportTable.paramGenGPR = spi0_paramGenAddr;
}
@ -263,7 +263,7 @@ void LatteShader_UpdatePSInputs(uint32* contextRegisters)
cemu_assert_debug(psSemanticId != 0xFF);
key += (uint64)psInputControl;
key = _rotl64(key, 7);
key = std::rotl(key, 7);
if (spi0_positionEnable && f == spi0_positionAddr)
{
_activePSImportTable.import[f].semanticId = LATTE_ANALYZER_IMPORT_INDEX_SPIPOSITION;
@ -546,7 +546,7 @@ uint64 LatteSHRC_CalcVSAuxHash(LatteDecompilerShader* vertexShader, uint32* cont
if(!vertexShader->streamoutBufferWriteMask2[i])
continue;
uint32 bufferStride = contextRegisters[mmVGT_STRMOUT_VTX_STRIDE_0 + i * 4];
auxHash = _rotl64(auxHash, 7);
auxHash = std::rotl(auxHash, 7);
auxHash += (uint64)bufferStride;
}
}
@ -559,7 +559,7 @@ uint64 LatteSHRC_CalcVSAuxHash(LatteDecompilerShader* vertexShader, uint32* cont
if ((word4 & 0x300) == 0x100)
{
// integer format
auxHashTex = _rotl64(auxHashTex, 7);
auxHashTex = std::rotl(auxHashTex, 7);
auxHashTex += 0x333;
}
}

View file

@ -124,8 +124,9 @@ struct LatteDecompilerCFInstruction
LatteDecompilerCFInstruction(LatteDecompilerCFInstruction&& mE) = default;
#else
LatteDecompilerCFInstruction(const LatteDecompilerCFInstruction& mE) = default;
LatteDecompilerCFInstruction(const LatteDecompilerCFInstruction&& mE) = default;
LatteDecompilerCFInstruction(LatteDecompilerCFInstruction&& mE) = default;
#endif
LatteDecompilerCFInstruction& operator=(LatteDecompilerCFInstruction&& mE) = default;
};

View file

@ -1463,7 +1463,7 @@ void OpenGLRenderer::shader_bind(RendererShader* shader)
prevGeometryShaderProgram = program;
break;
default:
__assume(false);
UNREACHABLE;
}
catchOpenGLError();
@ -1494,7 +1494,7 @@ void OpenGLRenderer::shader_unbind(RendererShader::ShaderType shaderType)
prevGeometryShaderProgram = -1;
break;
default:
__assume(false);
UNREACHABLE;
}
}

View file

@ -44,9 +44,9 @@ void OpenGLRenderer::uniformData_update()
for (sint32 f = 0; f < remappedArraySize; f++)
{
uniformDataHash[0] ^= remappedUniformData64[0];
uniformDataHash[0] = _rotl64(uniformDataHash[0], 11);
uniformDataHash[0] = std::rotl(uniformDataHash[0], 11);
uniformDataHash[1] ^= remappedUniformData64[1];
uniformDataHash[1] = _rotl64(uniformDataHash[1], 11);
uniformDataHash[1] = std::rotl(uniformDataHash[1], 11);
remappedUniformData64 += 2;
}
if (shader->uniformDataHash64[0] != uniformDataHash[0] || shader->uniformDataHash64[1] != uniformDataHash[1])

View file

@ -270,7 +270,7 @@ void RendererShaderGL::ShaderCacheLoading_begin(uint64 cacheTitleId)
usePrecompiled = false;
break;
default:
__assume(false);
UNREACHABLE;
}
forceLog_printf("Using precompiled shaders: %s", usePrecompiled ? "true" : "false");

View file

@ -1,7 +1,7 @@
#pragma once
#include "Cafe/HW/Latte/Renderer/RendererShader.h"
#include "Common\GLInclude\GLInclude.h"
#include "Common/GLInclude/GLInclude.h"
class RendererShaderGL : public RendererShader
{

View file

@ -140,8 +140,8 @@ const TBuiltInResource DefaultTBuiltInResource = {
/* .generalVaryingIndexing = */ 1,
/* .generalSamplerIndexing = */ 1,
/* .generalVariableIndexing = */ 1,
/* .generalConstantMatrixVectorIndexing = */ 1,
}
/* .generalConstantMatrixVectorIndexing = */ 1
}
};
class _ShaderVkThreadPool

View file

@ -3412,7 +3412,7 @@ VkDescriptorSetInfo::~VkDescriptorSetInfo()
break;
}
default:
__assume(false);
UNREACHABLE;
}
// update global stats
performanceMonitor.vk.numDescriptorSamplerTextures.decrement(statsNumSamplerTextures);
@ -4021,13 +4021,13 @@ VKRObjectRenderPass::VKRObjectRenderPass(AttachmentInfo_t& attachmentInfo, sint3
if (attachmentInfo.colorAttachment[i].isPresent || attachmentInfo.colorAttachment[i].viewObj)
{
stateHash += attachmentInfo.colorAttachment[i].format + i * 31;
stateHash = _rotl64(stateHash, 7);
stateHash = std::rotl(stateHash, 7);
}
}
if (attachmentInfo.depthAttachment.isPresent || attachmentInfo.depthAttachment.viewObj)
{
stateHash += attachmentInfo.depthAttachment.format;
stateHash = _rotl64(stateHash, 7);
stateHash = std::rotl(stateHash, 7);
}
m_hashForPipeline = stateHash;

View file

@ -24,18 +24,18 @@ uint64 VulkanRenderer::draw_calculateMinimalGraphicsPipelineHash(const LatteFetc
for (auto& group : fetchShader->bufferGroups)
{
uint32 bufferStride = group.getCurrentBufferStride(lcr.GetRawView());
stateHash = _rotl64(stateHash, 7);
stateHash = std::rotl(stateHash, 7);
stateHash += bufferStride * 3;
}
stateHash += fetchShader->getVkPipelineHashFragment();
stateHash = _rotl64(stateHash, 7);
stateHash = std::rotl(stateHash, 7);
stateHash += lcr.GetRawView()[mmVGT_PRIMITIVE_TYPE];
stateHash = _rotl64(stateHash, 7);
stateHash = std::rotl(stateHash, 7);
stateHash += lcr.GetRawView()[mmVGT_STRMOUT_EN];
stateHash = _rotl64(stateHash, 7);
stateHash = std::rotl(stateHash, 7);
if(lcr.PA_CL_CLIP_CNTL.get_DX_RASTERIZATION_KILL())
stateHash += 0x333333;
@ -66,24 +66,24 @@ uint64 VulkanRenderer::draw_calculateGraphicsPipelineHash(const LatteFetchShader
if (vertexShader)
stateHash += vertexShader->baseHash;
stateHash = _rotl64(stateHash, 13);
stateHash = std::rotl(stateHash, 13);
if (geometryShader)
stateHash += geometryShader->baseHash;
stateHash = _rotl64(stateHash, 13);
stateHash = std::rotl(stateHash, 13);
if (pixelShader)
stateHash += pixelShader->baseHash + pixelShader->auxHash;
stateHash = _rotl64(stateHash, 13);
stateHash = std::rotl(stateHash, 13);
uint32 polygonCtrl = lcr.PA_SU_SC_MODE_CNTL.getRawValue();
stateHash += polygonCtrl;
stateHash = _rotl64(stateHash, 7);
stateHash = std::rotl(stateHash, 7);
stateHash += ctxRegister[Latte::REGADDR::PA_CL_CLIP_CNTL];
stateHash = _rotl64(stateHash, 7);
stateHash = std::rotl(stateHash, 7);
const auto colorControlReg = ctxRegister[Latte::REGADDR::CB_COLOR_CONTROL];
stateHash += colorControlReg;
@ -97,7 +97,7 @@ uint64 VulkanRenderer::draw_calculateGraphicsPipelineHash(const LatteFetchShader
{
if (((blendEnableMask & (1 << i))) == 0)
continue;
stateHash = _rotl64(stateHash, 7);
stateHash = std::rotl(stateHash, 7);
stateHash += ctxRegister[Latte::REGADDR::CB_BLEND0_CONTROL + i];
}
}
@ -109,11 +109,11 @@ uint64 VulkanRenderer::draw_calculateGraphicsPipelineHash(const LatteFetchShader
if (stencilTestEnable)
{
stateHash += ctxRegister[mmDB_STENCILREFMASK];
stateHash = _rotl64(stateHash, 17);
stateHash = std::rotl(stateHash, 17);
if(depthControl & (1<<7)) // back stencil enable
{
stateHash += ctxRegister[mmDB_STENCILREFMASK_BF];
stateHash = _rotl64(stateHash, 13);
stateHash = std::rotl(stateHash, 13);
}
}
else
@ -122,7 +122,7 @@ uint64 VulkanRenderer::draw_calculateGraphicsPipelineHash(const LatteFetchShader
depthControl &= 0xFF;
}
stateHash = _rotl64(stateHash, 17);
stateHash = std::rotl(stateHash, 17);
stateHash += depthControl;
// polygon offset
@ -528,7 +528,7 @@ uint64 VulkanRenderer::GetDescriptorSetStateHash(LatteDecompilerShader* shader)
texUnitRegIndex += Latte::REGADDR::SQ_TEX_RESOURCE_WORD0_N_GS;
break;
default:
__assume(false);
UNREACHABLE;
}
auto texture = m_state.boundTexture[hostTextureUnit];
@ -542,16 +542,16 @@ uint64 VulkanRenderer::GetDescriptorSetStateHash(LatteDecompilerShader* shader)
{
samplerIndex += LatteDecompiler_getTextureSamplerBaseIndex(shader->shaderType);
hash += LatteGPUState.contextRegister[Latte::REGADDR::SQ_TEX_SAMPLER_WORD0_0 + samplerIndex * 3 + 0];
hash = _rotl64(hash, 7);
hash = std::rotl(hash, 7);
hash += LatteGPUState.contextRegister[Latte::REGADDR::SQ_TEX_SAMPLER_WORD0_0 + samplerIndex * 3 + 1];
hash = _rotl64(hash, 7);
hash = std::rotl(hash, 7);
hash += LatteGPUState.contextRegister[Latte::REGADDR::SQ_TEX_SAMPLER_WORD0_0 + samplerIndex * 3 + 2];
hash = _rotl64(hash, 7);
hash = std::rotl(hash, 7);
}
hash = _rotl64(hash, 7);
hash = std::rotl(hash, 7);
// hash view id + swizzle mask
hash += (uint64)texture->GetUniqueId();
hash = _rotr64(hash, 21);
hash = std::rotr(hash, 21);
hash += (uint64)(word4 & 0x0FFF0000);
}
@ -590,7 +590,7 @@ VkDescriptorSetInfo* VulkanRenderer::draw_getOrCreateDescriptorSet(PipelineInfo*
break;
}
default:
__assume(false);
UNREACHABLE;
}
// create new descriptor set
@ -646,7 +646,7 @@ VkDescriptorSetInfo* VulkanRenderer::draw_getOrCreateDescriptorSet(PipelineInfo*
texUnitRegIndex += Latte::REGADDR::SQ_TEX_RESOURCE_WORD0_N_GS;
break;
default:
__assume(false);
UNREACHABLE;
}
auto textureView = m_state.boundTexture[hostTextureUnit];
@ -996,7 +996,7 @@ VkDescriptorSetInfo* VulkanRenderer::draw_getOrCreateDescriptorSet(PipelineInfo*
break;
}
default:
__assume(false);
UNREACHABLE;
}
return dsInfo;

View file

@ -108,12 +108,12 @@ uint64 VulkanRenderer::copySurface_getPipelineStateHash(VkCopySurfaceState_t& st
uint64 h = 0;
h += (uintptr_t)state.destinationTexture->GetFormat();
h = _rotr64(h, 7);
h = std::rotr(h, 7);
h += state.sourceTexture->isDepth ? 0x1111ull : 0;
h = _rotr64(h, 7);
h = std::rotr(h, 7);
h += state.destinationTexture->isDepth ? 0x1112ull : 0;
h = _rotr64(h, 7);
h = std::rotr(h, 7);
return h;
}

View file

@ -713,8 +713,8 @@ void _calculateMappedImportNameHash(const char* rplName, const char* funcName, u
uint64 v = (uint64)*rplName;
h1 += v;
h2 ^= v;
h1 = _rotl64(h1, 3);
h2 = _rotl64(h2, 7);
h1 = std::rotl(h1, 3);
h2 = std::rotl(h2, 7);
rplName++;
}
// funcName
@ -723,8 +723,8 @@ void _calculateMappedImportNameHash(const char* rplName, const char* funcName, u
uint64 v = (uint64)*funcName;
h1 += v;
h2 ^= v;
h1 = _rotl64(h1, 3);
h2 = _rotl64(h2, 7);
h1 = std::rotl(h1, 3);
h2 = std::rotl(h2, 7);
funcName++;
}
*h1Out = h1;

View file

@ -217,4 +217,4 @@ void osLib_load()
swkbd::load();
camera::load();
procui_load();
}
}

View file

@ -398,7 +398,7 @@ namespace coreinit
else
track = (MEMBlockHeapTrackDEPR*)memory_getPointerFromVirtualOffsetAllowNull(_swapEndianU32(blockHeapHead->headBlock));
cemu_assert_debug(__popcnt(alignment) == 1); // not a supported alignment value
cemu_assert_debug(std::popcount<unsigned int>(alignment) == 1); // not a supported alignment value
while (track)
{
if (track->isFree != _swapEndianU32(0))

View file

@ -45,8 +45,8 @@ namespace coreinit
bool g_isMulticoreMode;
__declspec(thread) uint32 t_assignedCoreIndex;
__declspec(thread) Fiber* t_schedulerFiber;
THREAD_LOCAL uint32 t_assignedCoreIndex;
THREAD_LOCAL Fiber* t_schedulerFiber;
struct OSHostThread
{

View file

@ -28,7 +28,7 @@ namespace coreinit
osLib_returnFromFunction64(hCPU, osTime);
}
__declspec(noinline) uint64 coreinit_getTimeBase_dummy()
uint64 coreinit_getTimeBase_dummy()
{
return __rdtsc();
}

View file

@ -201,8 +201,8 @@ static_assert(sizeof(CURLMsg_t) <= 0xC, "sizeof(CURLMsg_t)");
size_t header_callback(char* buffer, size_t size, size_t nitems, void* userdata);
__declspec(thread) PPCConcurrentQueue<QueueMsg_t>* g_callerQueue;
__declspec(thread) ConcurrentQueue<QueueMsg_t>* g_threadQueue;
THREAD_LOCAL PPCConcurrentQueue<QueueMsg_t>* g_callerQueue;
THREAD_LOCAL ConcurrentQueue<QueueMsg_t>* g_threadQueue;
void CurlWorkerThread(CURL_t* curl, PPCConcurrentQueue<QueueMsg_t>* callerQueue, ConcurrentQueue<QueueMsg_t>* threadQueue)
{
g_callerQueue = callerQueue;

View file

@ -174,7 +174,7 @@ std::unique_ptr<uint8[]> MetaInfo::GetIcon(uint32& size) const
return nullptr;
}
default:
__assume(false);
UNREACHABLE;
}
return nullptr;
}