Re: [hatari-devel] FPU update

[ Thread Index | Date Index | More Archives ]

Am 29.01.2017 um 21:30 schrieb Toni Wilen <twilen@xxxxxxxxxx>:

Here is the updated version. The expectd.dat has grown because a result
is recorded for every outcome, not just the branch-not-taken cases as it
was before. Keypress should work properly now in those tests. Opcode
sequence reporting has also been fixed to print the right number of ops.


Could you describe what errors in attached image mean? I can see that
tested instructions are FCMP and FBOGL but where does those values come
from and why it failed?

Oops. It was a bug..

Now only one fcmp/fbcc remaining. (plus fmod/frem and then comes
trigonometric functions)


Please test if this modification of fpsr_set_result fixes the issue. Datasheet says that NaNs can be negative. But i think that might be just wrong. Maybe some more testing on real hardware makes sense to confirm this.

void fpsr_set_result(fptype *result)
    // condition code byte
    regs.fpsr &= 0x00fffff8; // clear cc
    if (fp_is_nan (result)) {
        regs.fpsr |= FPSR_CC_NAN;
        // check if nan is signaling
        if (fp_is_snan(result)) {
            regs.fpsr |= FPSR_SNAN;
    } else {
        if (fp_is_zero(result)) {
            regs.fpsr |= FPSR_CC_Z;
        } else if (fp_is_infinity (result)) {
            regs.fpsr |= FPSR_CC_I;
        if (fp_is_neg(result)) {
            regs.fpsr |= FPSR_CC_N;

Mail converted by MHonArc 2.6.19+