fixed floats in printf in linux59k platform

problem was implementation of fint & fintrz floating point ops in m68kfpu.c
Both these ops truncated the integer to 32 bits instead of leaving it as an extended precision floating point number

Changed the implementation to use 64 bit ints instead of 32 bit ints.
This commit is contained in:
tevorbl 2020-06-01 20:53:29 +01:00
parent e5da3227d9
commit 04fe0aa53e

View file

@ -967,7 +967,7 @@ static void WRITE_EA_64(int ea, uint64 data)
m68ki_write_32(ea+4, (uint32)(data));
break;
}
default: fatalerror("M68kFPU: WRITE_EA_32: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC);
default: fatalerror("M68kFPU: WRITE_EA_64: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC);
}
break;
}
@ -1224,17 +1224,17 @@ static void fpgen_rm_reg(uint16 w2)
}
case 0x01: // Fsint
{
sint32 temp;
temp = floatx80_to_int32(source);
REG_FP[dst] = int32_to_floatx80(temp);
sint64 temp;
temp = floatx80_to_int64(source);
REG_FP[dst] = int64_to_floatx80(temp);
SET_CONDITION_CODES(REG_FP[dst]); // JFF needs update condition codes
break;
}
case 0x03: // FsintRZ
{
sint32 temp;
temp = floatx80_to_int32_round_to_zero(source);
REG_FP[dst] = int32_to_floatx80(temp);
sint64 temp;
temp = floatx80_to_int64_round_to_zero(source);
REG_FP[dst] = int64_to_floatx80(temp);
SET_CONDITION_CODES(REG_FP[dst]); // JFF needs update condition codes
break;
}