2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00
yuzu/src/core
Lioncash b879fb84a2 svc: Correct always true assertion case in SetThreadCoreMask
The reason this would never be true is that ideal_processor is a u8 and
THREADPROCESSORID_DEFAULT is an s32. In this case, it boils down to how
arithmetic conversions are performed before performing the comparison.

If an unsigned value has a lesser conversion rank (aka smaller size)
than the signed type being compared, then the unsigned value is promoted
to the signed value (i.e. u8 -> s32 happens before the comparison). No
sign-extension occurs here either.

An alternative phrasing:

Say we have a variable named core and it's given a value of -2.

u8 core = -2;

This becomes 254 due to the lack of sign. During integral promotion to
the signed type, this still remains as 254, and therefore the condition
will always be true, because no matter what value the u8 is given it
will never be -2 in terms of 32 bits.

Now, if one type was a s32 and one was a u32, this would be entirely
different, since they have the same bit width (and the signed type would
be converted to unsigned instead of the other way around) but would
still have its representation preserved in terms of bits, allowing the
comparison to be false in some cases, as opposed to being true all the
time.

---

We also get rid of two signed/unsigned comparison warnings while we're
at it.
2018-07-19 15:46:17 -04:00
..
arm scheduler: Clear exclusive state when switching contexts 2018-07-16 11:24:00 +01:00
file_sys Merge pull request #703 from lioncash/const 2018-07-19 08:46:15 -07:00
frontend Rename logging macro back to LOG_* 2018-07-02 21:45:47 -04:00
gdbstub More improvements to GDBStub (#653) 2018-07-12 20:22:59 -07:00
hle svc: Correct always true assertion case in SetThreadCoreMask 2018-07-19 15:46:17 -04:00
hw Rename logging macro back to LOG_* 2018-07-02 21:45:47 -04:00
loader Virtual Filesystem 2: Electric Boogaloo (#676) 2018-07-18 18:07:11 -07:00
tracer Rename logging macro back to LOG_* 2018-07-02 21:45:47 -04:00
CMakeLists.txt Virtual Filesystem 2: Electric Boogaloo (#676) 2018-07-18 18:07:11 -07:00
core.cpp Merge pull request #687 from lioncash/instance 2018-07-18 18:55:58 -07:00
core.h core: Make System's default constructor private 2018-07-18 18:18:27 -04:00
core_cpu.cpp Rename logging macro back to LOG_* 2018-07-02 21:45:47 -04:00
core_cpu.h core: Support session close with multicore. 2018-05-10 19:34:47 -04:00
core_timing.cpp Rename logging macro back to LOG_* 2018-07-02 21:45:47 -04:00
core_timing.h core_timing: Don't include the log header in core timing's header 2018-05-03 08:00:15 -04:00
memory.cpp Merge pull request #690 from lioncash/move 2018-07-18 20:55:55 -07:00
memory.h Kernel/Arbiters: Fix casts, cleanup comments/magic numbers 2018-06-22 00:47:59 -06:00
memory_hook.cpp memory_hook: Default virtual destructor in the cpp file 2018-05-03 08:12:16 -04:00
memory_hook.h memory_hook: Default virtual destructor in the cpp file 2018-05-03 08:12:16 -04:00
memory_setup.h memory: Replace all memory hooking with Special regions 2018-01-27 15:16:39 +00:00
perf_stats.cpp math_util: Remove the Clamp() function 2018-04-20 10:14:13 -04:00
perf_stats.h
settings.cpp
settings.h settings: Add a configuration for use_accurate_framebuffers. 2018-06-27 00:08:04 -04:00
telemetry_session.cpp Rename logging macro back to LOG_* 2018-07-02 21:45:47 -04:00
telemetry_session.h telemetry_session.h: Reword Documentation Comment from citra to yuzu 2018-03-27 11:16:59 +02:00