m68k improvements: [Hans Ostermeyer]

- Fixed BFINS, BFEXTU, and BFEXTS to fetch 8-bit quantities as 8 bits (corrects Domain/OS 10.3.5 crash on page boundry)
- Added SoftFloat log functions and m68k FLOGNP1, FLOGN, FLOG2, and FLOG10 instructions
This commit is contained in:
Miodrag Milanovic 2012-04-09 06:00:44 +00:00
parent 4f2850b93c
commit bbddee4a75
2 changed files with 39 additions and 4 deletions

View File

@ -2660,7 +2660,8 @@ M68KMAKE_OP(bfexts, 32, ., .)
}
width = ((width-1) & 31) + 1;
data = (offset+width) < 16 ? (m68ki_read_16((mc68kcpu), ea) << 16) : m68ki_read_32((mc68kcpu), ea);
data = (offset+width) < 8 ? (m68ki_read_8((mc68kcpu), ea) << 24) :
(offset+width) < 16 ? (m68ki_read_16((mc68kcpu), ea) << 16) : m68ki_read_32((mc68kcpu), ea);
data = MASK_OUT_ABOVE_32(data<<offset);
@ -2745,7 +2746,8 @@ M68KMAKE_OP(bfextu, 32, ., .)
}
width = ((width-1) & 31) + 1;
data = (offset+width) < 16 ? (m68ki_read_16((mc68kcpu), ea) << 16) : m68ki_read_32((mc68kcpu), ea);
data = (offset+width) < 8 ? (m68ki_read_8((mc68kcpu), ea) << 24) :
(offset+width) < 16 ? (m68ki_read_16((mc68kcpu), ea) << 16) : m68ki_read_32((mc68kcpu), ea);
data = MASK_OUT_ABOVE_32(data<<offset);
if((offset+width) > 32)
@ -2942,11 +2944,16 @@ M68KMAKE_OP(bfins, 32, ., .)
(mc68kcpu)->not_z_flag = insert_base;
insert_long = insert_base >> offset;
data_long = (offset+width) < 16 ? (m68ki_read_16((mc68kcpu), ea) << 16) : m68ki_read_32((mc68kcpu), ea);
data_long = (offset+width) < 8 ? (m68ki_read_8((mc68kcpu), ea) << 24) :
(offset+width) < 16 ? (m68ki_read_16((mc68kcpu), ea) << 16) : m68ki_read_32((mc68kcpu), ea);
(mc68kcpu)->v_flag = VFLAG_CLEAR;
(mc68kcpu)->c_flag = CFLAG_CLEAR;
if((width + offset) < 16)
if((width + offset) < 8)
{
m68ki_write_8((mc68kcpu), ea, ((data_long & ~mask_long) | insert_long) >> 24);
}
else if((width + offset) < 16)
{
m68ki_write_16((mc68kcpu), ea, ((data_long & ~mask_long) | insert_long) >> 16);
}

View File

@ -1321,6 +1321,13 @@ static void fpgen_rm_reg(m68ki_cpu_core *m68k, UINT16 w2)
m68k->remaining_cycles -= 109;
break;
}
case 0x06: // FLOGNP1
{
REG_FP(m68k)[dst] = floatx80_flognp1 (source);
SET_CONDITION_CODES(m68k, REG_FP(m68k)[dst]);
m68k->remaining_cycles -= 594; // for MC68881
break;
}
case 0x0e: // FSIN
{
REG_FP(m68k)[dst] = source;
@ -1337,6 +1344,27 @@ static void fpgen_rm_reg(m68ki_cpu_core *m68k, UINT16 w2)
m68k->remaining_cycles -= 75;
break;
}
case 0x14: // FLOGN
{
REG_FP(m68k)[dst] = floatx80_flogn (source);
SET_CONDITION_CODES(m68k, REG_FP(m68k)[dst]);
m68k->remaining_cycles -= 548; // for MC68881
break;
}
case 0x15: // FLOG10
{
REG_FP(m68k)[dst] = floatx80_flog10 (source);
SET_CONDITION_CODES(m68k, REG_FP(m68k)[dst]);
m68k->remaining_cycles -= 604; // for MC68881
break;
}
case 0x16: // FLOG2
{
REG_FP(m68k)[dst] = floatx80_flog2 (source);
SET_CONDITION_CODES(m68k, REG_FP(m68k)[dst]);
m68k->remaining_cycles -= 604; // for MC68881
break;
}
case 0x18: // FABS
{
REG_FP(m68k)[dst] = source;