Re: [PATCH v2 4/4] target/m68k: fix FPSR quotient byte for frem instruction

2023-01-08 Thread Richard Henderson
On 1/7/23 15:00, Mark Cave-Ayland wrote:   void HELPER(frem)(CPUM68KState *env, FPReg *res, FPReg *val0, FPReg *val1)   { +    float_status fp_status; +    FPReg fp_quot;   uint32_t quotient;   int sign; +    /* Calculate quotient directly using round to nearest mode */ +   

Re: [PATCH v2 4/4] target/m68k: fix FPSR quotient byte for frem instruction

2023-01-07 Thread Mark Cave-Ayland
On 04/01/2023 18:04, Richard Henderson wrote: On 1/4/23 05:45, Mark Cave-Ayland wrote: The FPSR quotient byte should be set to the value of the quotient and not the result. Manually calculate the quotient in the frem helper in round to nearest even mode (note this is different from the

Re: [PATCH v2 4/4] target/m68k: fix FPSR quotient byte for frem instruction

2023-01-04 Thread Richard Henderson
On 1/4/23 05:45, Mark Cave-Ayland wrote: The FPSR quotient byte should be set to the value of the quotient and not the result. Manually calculate the quotient in the frem helper in round to nearest even mode (note this is different from the quotient calculated internally for fmod), and use it to

[PATCH v2 4/4] target/m68k: fix FPSR quotient byte for frem instruction

2023-01-04 Thread Mark Cave-Ayland
The FPSR quotient byte should be set to the value of the quotient and not the result. Manually calculate the quotient in the frem helper in round to nearest even mode (note this is different from the quotient calculated internally for fmod), and use it to set the quotient byte accordingly.