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

@ -2880,7 +2880,7 @@ void ppu_acontext::MFOCRF(ppu_opcode_t op)
void ppu_acontext::LWARX(ppu_opcode_t op)
{
gpr[op.rd] = spec_gpr::range(0, UINT32_MAX);
gpr[op.rd] = spec_gpr::range(0, u32{umax});
}
void ppu_acontext::LDX(ppu_opcode_t op)