types.hpp: implement smin, smax, amin, amax

Rewritten the following global utility constants:
`umax` returns max number, restricted to unsigned.
`smax` returns max signed number, restricted to integrals.
`smin` returns min signed number, restricted to signed.
`amin` returns smin or zero, less restricted.
`amax` returns smax or umax, less restricted.

Fix operators == and <=> for synthesized rel-ops.
This commit is contained in:
Nekotekina 2021-05-22 10:35:15 +03:00
parent 613777afde
commit 160b131de3
38 changed files with 219 additions and 111 deletions

View file

@ -913,7 +913,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
}
case CELL_SAVEDATA_FOCUSPOS_LATEST:
{
s64 max = INT64_MIN;
s64 max = smin;
for (u32 i = 0; i < save_entries.size(); i++)
{
@ -928,7 +928,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
}
case CELL_SAVEDATA_FOCUSPOS_OLDEST:
{
s64 min = INT64_MAX;
s64 min = smax;
for (u32 i = 0; i < save_entries.size(); i++)
{