mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-10 12:39:59 +00:00
Fix warnings related to parentheses
This commit is contained in:
parent
32f8f40a4a
commit
be521ff0ab
@ -1160,7 +1160,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
|
||||
}
|
||||
};
|
||||
|
||||
if ((d_size | d_size + addr) >= 0x100000000ull)
|
||||
if ((d_size | (d_size + addr)) >= 0x100000000ull)
|
||||
{
|
||||
LOG_ERROR(MEMORY, "Invalid d_size (0x%llx)", d_size);
|
||||
report_opcode();
|
||||
@ -1170,7 +1170,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
|
||||
// get length of data being accessed
|
||||
size_t a_size = get_x64_access_size(context, op, reg, d_size, i_size);
|
||||
|
||||
if ((a_size | a_size + addr) >= 0x100000000ull)
|
||||
if ((a_size | (a_size + addr)) >= 0x100000000ull)
|
||||
{
|
||||
LOG_ERROR(MEMORY, "Invalid a_size (0x%llx)", a_size);
|
||||
report_opcode();
|
||||
|
@ -853,7 +853,7 @@ s32 cellGemPrepareVideoConvert(vm::cptr<CellGemVideoConvertAttribute> vc_attribu
|
||||
const auto vc = *vc_attribute;
|
||||
|
||||
if (!vc_attribute || vc.version == 0 || vc.output_format == 0 ||
|
||||
vc.conversion_flags & CELL_GEM_COMBINE_PREVIOUS_INPUT_FRAME && !vc.buffer_memory)
|
||||
(vc.conversion_flags & CELL_GEM_COMBINE_PREVIOUS_INPUT_FRAME && !vc.buffer_memory))
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
@ -1112,7 +1112,7 @@ void PPUTranslator::VMSUMUHS(ppu_opcode_t op)
|
||||
const auto mh = noncast<u32[4]>((a >> 16) * (b >> 16));
|
||||
const auto s = eval(ml + mh);
|
||||
const auto s2 = eval(s + c);
|
||||
const auto x = eval(s < ml | s2 < s);
|
||||
const auto x = eval((s < ml) | (s2 < s));
|
||||
set_vr(op.vd, select(x, splat<u32[4]>(-1), s2));
|
||||
SetSat(IsNotZero(x.value));
|
||||
}
|
||||
|
@ -333,13 +333,13 @@ bool spu_interpreter::ROTI(spu_thread& spu, spu_opcode_t op)
|
||||
|
||||
bool spu_interpreter::ROTMI(spu_thread& spu, spu_opcode_t op)
|
||||
{
|
||||
spu.gpr[op.rt].vi = _mm_srli_epi32(spu.gpr[op.ra].vi, 0-op.i7 & 0x3f);
|
||||
spu.gpr[op.rt].vi = _mm_srli_epi32(spu.gpr[op.ra].vi, (0-op.i7) & 0x3f);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool spu_interpreter::ROTMAI(spu_thread& spu, spu_opcode_t op)
|
||||
{
|
||||
spu.gpr[op.rt].vi = _mm_srai_epi32(spu.gpr[op.ra].vi, 0-op.i7 & 0x3f);
|
||||
spu.gpr[op.rt].vi = _mm_srai_epi32(spu.gpr[op.ra].vi, (0-op.i7) & 0x3f);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -359,13 +359,13 @@ bool spu_interpreter::ROTHI(spu_thread& spu, spu_opcode_t op)
|
||||
|
||||
bool spu_interpreter::ROTHMI(spu_thread& spu, spu_opcode_t op)
|
||||
{
|
||||
spu.gpr[op.rt].vi = _mm_srli_epi16(spu.gpr[op.ra].vi, 0-op.i7 & 0x1f);
|
||||
spu.gpr[op.rt].vi = _mm_srli_epi16(spu.gpr[op.ra].vi, (0-op.i7) & 0x1f);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool spu_interpreter::ROTMAHI(spu_thread& spu, spu_opcode_t op)
|
||||
{
|
||||
spu.gpr[op.rt].vi = _mm_srai_epi16(spu.gpr[op.ra].vi, 0-op.i7 & 0x1f);
|
||||
spu.gpr[op.rt].vi = _mm_srai_epi16(spu.gpr[op.ra].vi, (0-op.i7) & 0x1f);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -708,7 +708,7 @@ bool spu_interpreter::ROTQMBY(spu_thread& spu, spu_opcode_t op)
|
||||
{
|
||||
const auto a = spu.gpr[op.ra].vi;
|
||||
alignas(64) const __m128i buf[3]{a, _mm_setzero_si128(), _mm_setzero_si128()};
|
||||
spu.gpr[op.rt].vi = _mm_loadu_si128((__m128i*)((u8*)buf + (0 - spu.gpr[op.rb]._u32[3] & 0x1f)));
|
||||
spu.gpr[op.rt].vi = _mm_loadu_si128((__m128i*)((u8*)buf + ((0 - spu.gpr[op.rb]._u32[3]) & 0x1f)));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -789,7 +789,7 @@ bool spu_interpreter::ROTQBII(spu_thread& spu, spu_opcode_t op)
|
||||
bool spu_interpreter::ROTQMBII(spu_thread& spu, spu_opcode_t op)
|
||||
{
|
||||
const auto a = spu.gpr[op.ra].vi;
|
||||
const s32 n = 0-op.i7 & 0x7;
|
||||
const s32 n = (0-op.i7) & 0x7;
|
||||
spu.gpr[op.rt].vi = _mm_or_si128(_mm_srli_epi64(a, n), _mm_slli_epi64(_mm_srli_si128(a, 8), 64 - n));
|
||||
return true;
|
||||
}
|
||||
@ -814,7 +814,7 @@ bool spu_interpreter::ROTQMBYI(spu_thread& spu, spu_opcode_t op)
|
||||
{
|
||||
const auto a = spu.gpr[op.ra].vi;
|
||||
alignas(64) const __m128i buf[3]{a, _mm_setzero_si128(), _mm_setzero_si128()};
|
||||
spu.gpr[op.rt].vi = _mm_loadu_si128((__m128i*)((u8*)buf + (0 - op.i7 & 0x1f)));
|
||||
spu.gpr[op.rt].vi = _mm_loadu_si128((__m128i*)((u8*)buf + ((0 - op.i7) & 0x1f)));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2995,7 +2995,7 @@ bool spu_thread::stop_and_signal(u32 code)
|
||||
{
|
||||
if (spuq == v.first)
|
||||
{
|
||||
if (queue = v.second.lock())
|
||||
if ((queue = v.second.lock()))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ vertex_program_utils::vertex_program_metadata vertex_program_utils::analyse_vert
|
||||
}
|
||||
}
|
||||
|
||||
if (d3.end && (fast_exit || current_instrution >= instruction_range.second) ||
|
||||
if ((d3.end && (fast_exit || current_instrution >= instruction_range.second)) ||
|
||||
(current_instrution + 1) == 512)
|
||||
{
|
||||
break;
|
||||
|
@ -74,7 +74,7 @@ namespace rsx
|
||||
}
|
||||
else
|
||||
max_mipmap_count = floor_log2(static_cast<u32>(std::max(width(), height()))) + 1;
|
||||
|
||||
|
||||
return std::min(verify(HERE, mipmap()), max_mipmap_count);
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ namespace rsx
|
||||
if (remap_override)
|
||||
{
|
||||
auto r_component = (remap_ctl >> 2) & 3;
|
||||
remap_ctl = remap_ctl & ~(3 << 4) | r_component << 4;
|
||||
remap_ctl = (remap_ctl & ~(3 << 4)) | r_component << 4;
|
||||
}
|
||||
|
||||
remap_ctl &= 0xFFFF;
|
||||
@ -181,7 +181,7 @@ namespace rsx
|
||||
if (remap_override)
|
||||
{
|
||||
//Set remap lookup for A component to FORCE_ONE
|
||||
remap_ctl = remap_ctl & ~(3 << 8) | (1 << 8);
|
||||
remap_ctl = (remap_ctl & ~(3 << 8)) | (1 << 8);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -190,7 +190,7 @@ namespace rsx
|
||||
}
|
||||
|
||||
//Remapping tables; format is A-R-G-B
|
||||
//Remap input table. Contains channel index to read color from
|
||||
//Remap input table. Contains channel index to read color from
|
||||
const std::array<u8, 4> remap_inputs =
|
||||
{
|
||||
static_cast<u8>(remap_ctl & 0x3),
|
||||
|
@ -1301,16 +1301,16 @@ namespace rsx
|
||||
void rsx_state::init()
|
||||
{
|
||||
// Special values set at initialization, these are not set by a context reset
|
||||
registers[NV4097_SET_SHADER_PROGRAM] = (0 << 2) | CELL_GCM_LOCATION_LOCAL + 1;
|
||||
registers[NV4097_SET_SHADER_PROGRAM] = (0 << 2) | (CELL_GCM_LOCATION_LOCAL + 1);
|
||||
|
||||
for (u32 i = 0; i < 16; i++)
|
||||
{
|
||||
registers[NV4097_SET_TEXTURE_FORMAT + (i * 8)] = (1 << 16 /* mipmap */) | ((CELL_GCM_TEXTURE_R5G6B5 | CELL_GCM_TEXTURE_SZ | CELL_GCM_TEXTURE_NR) << 8) | (2 << 4 /* 2D */) | CELL_GCM_LOCATION_LOCAL + 1;
|
||||
registers[NV4097_SET_TEXTURE_FORMAT + (i * 8)] = (1 << 16 /* mipmap */) | ((CELL_GCM_TEXTURE_R5G6B5 | CELL_GCM_TEXTURE_SZ | CELL_GCM_TEXTURE_NR) << 8) | (2 << 4 /* 2D */) | (CELL_GCM_LOCATION_LOCAL + 1);
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < 4; i++)
|
||||
{
|
||||
registers[NV4097_SET_VERTEX_TEXTURE_FORMAT + (i * 8)] = (1 << 16 /* mipmap */) | ((CELL_GCM_TEXTURE_X32_FLOAT | CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_NR) << 8) | (2 << 4 /* 2D */) | CELL_GCM_LOCATION_LOCAL + 1;
|
||||
registers[NV4097_SET_VERTEX_TEXTURE_FORMAT + (i * 8)] = (1 << 16 /* mipmap */) | ((CELL_GCM_TEXTURE_X32_FLOAT | CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_NR) << 8) | (2 << 4 /* 2D */) | (CELL_GCM_LOCATION_LOCAL + 1);
|
||||
}
|
||||
|
||||
registers[NV406E_SET_CONTEXT_DMA_SEMAPHORE] = CELL_GCM_CONTEXT_DMA_SEMAPHORE_R;
|
||||
|
@ -1347,7 +1347,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
|
||||
elf_file.open(decrypted_path);
|
||||
}
|
||||
// Decrypt SELF
|
||||
else if (elf_file = decrypt_self(std::move(elf_file), klic.empty() ? nullptr : klic.data()))
|
||||
else if ((elf_file = decrypt_self(std::move(elf_file), klic.empty() ? nullptr : klic.data())))
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user