Re: [PATCH v4 2/4] target/sh4: Fix SUBV opcode

2024-05-01 Thread Yoshinori Sato
On Wed, 01 May 2024 01:31:23 +0900, Philippe Mathieu-Daudé wrote: > > The documentation says: > > SUBV Rm, RnRn - Rm -> Rn, underflow -> T > > The overflow / underflow can be calculated as: > > T = ((Rn ^ Rm) & (Result ^ Rn)) >> 31 > > However we were using the incorrect: > > T

[PATCH v4 2/4] target/sh4: Fix SUBV opcode

2024-04-30 Thread Philippe Mathieu-Daudé
The documentation says: SUBV Rm, RnRn - Rm -> Rn, underflow -> T The overflow / underflow can be calculated as: T = ((Rn ^ Rm) & (Result ^ Rn)) >> 31 However we were using the incorrect: T = ((Rn ^ Rm) & (Result ^ Rm)) >> 31 Fix by using the Rn register instead of Rm. Add tests