Commit graph

20 commits

Author SHA1 Message Date
bebbo
ffdd51b18a implement and fix some fpu instructions 2024-02-03 21:32:57 +01:00
Poul-Henning Kamp
5f08834807 Make diagnostic functions take const char * arguments. 2021-08-15 07:01:12 +00:00
jotd
8541cd65d5 fscc instruction: added (disp,Ax) mode 2020-06-09 23:13:45 +02:00
jotd
8633295412 in m68k_in.c
- fixed all CHK2/CMP2 instructions to support signed bounds. Previously it only worked with unsigned. Also sped up a bit
  by changing | by || in Z evaluation formula
- cptrapcc opcodes are still unsupported, but if no exception occurs, at least PC is properly updated
- trapt/trapcc 16 & 32 instructions: PC is updated before exception is triggered (or if exception isn't triggered). This fixes the
  return address value (just in case code returns from trap with RTE) and also the stackframe (XDAda 68040 compiler
  read the data parameter to check exception type, wrong exception type is read if stackframe is incorrect)

in m68kfpu.c

- fatalerror message fprintf => vfprintf
- added address register + displacement mode (mode 5, READ_EA_FPE/WRITE_EA_FPE), also changed prototype to it can be called with this mode
  from FMOVEM loop
- added immediate mode (READ_EA_FPE)
- fpgen_rm_reg (FMOVE to register): added a lot of missing condition code update (SET_CONDITION_CODES(REG_FP[dst]))
- added FSDIVS and FSMULS (easy as it's the same case as FDIV and FMUL). Updated condition codes for FDIV
- fmove_fpcr: connected softfloat 4 rounding modes to this instruction, that didn't set rounding at all, when it's
  perfectly emulated in softfloat module (just added:  float_rounding_mode = (REG_FPCR >> 4) & 0x3;)
- fmovem: added address register+displacement mode (READ_EA_FPE/WRITE_EA_FPE interface had to be changed)
- added FScc instruction
- note: number of cycles for the added instructions isn't exact
2020-06-07 11:45:28 +02:00
jotd
3b8e84fd83 m68k_in.c:
- fixed all CHK2/CMP2 instructions to support signed bounds. Previously it only worked with unsigned. Also sped up a bit
  by changing | by || in Z evaluation formula
- cptrapcc opcodes are still unsupported, but if no exception occurs, at least PC is properly updated
- trapt/trapcc 16 & 32 instructions: PC is updated before exception is triggered (or if exception isn't triggered). This fixes the
  return address value (just in case code returns from trap with RTE) and also the stackframe (XDAda 68040 compiler
  read the data parameter to check exception type, wrong exception type is read if stackframe is incorrect)

m68kfpu.c:

- fatalerror message fprintf => vfprintf
- added address register + displacement mode (mode 5, READ_EA_FPE/WRITE_EA_FPE), also changed prototype to it can be called with this mode
  from FMOVEM loop
- added immediate mode (READ_EA_FPE)
- fpgen_rm_reg (FMOVE to register): added a lot of missing condition code update (SET_CONDITION_CODES(REG_FP[dst]))
- added FSDIVS and FSMULS (easy as it's the same case as FDIV and FMUL). Updated condition codes for FDIV
- fmove_fpcr: connected softfloat 4 rounding modes to this instruction, that didn't set rounding at all, when it's
  perfectly emulated in softfloat module (just added:  float_rounding_mode = (REG_FPCR >> 4) & 0x3;)
- fmovem: added address register+displacement mode (READ_EA_FPE/WRITE_EA_FPE interface had to be changed)
- added FScc instruction
- note: number of cycles for the added instructions isn't exact
2020-06-06 14:41:52 +02:00
R. Belmont
de395aa3de M68k: Add more conditionals and FGETEXP instruction [R. Belmont] 2019-12-14 15:11:55 +01:00
R. Belmont
3db368e052 m680x0 FPU updates: [R. Belmont]
- BCD packed decimal now supported, including k-factor
 - Improved FSAVE/FRESTORE including FPU reset when restoring a NULL frame
 - FREM instruction supported
 - Better disassembly of FPU instructions
2019-12-14 15:06:35 +01:00
R. Belmont
3ec8f605b4 680x0 FPU update: [R. Belmont]
- Implemented FMOVECR
 - Added load extended PC relative indexed support
 - Cleanup some duplicated code
2019-12-14 14:38:14 +01:00
R. Belmont
7a934a8506 680x0 FPU updates [R. Belmont]
- Rewritten to use SoftFloat instead of unportable native FP math
 - Support added for Motorola 96-bit extended floats
 - More addressing modes and conditions supported

The taitojc games function identically to the old implementation (I stepped
through the main matrix multiply in dendeg and the registers never diverged)
and speed on Core 2 Duo is a wash - sometimes softfloat's faster, sometimes
not, but the difference on -str 90 never exceeded 1%.
2019-12-14 13:14:18 +01:00
Emmanuel Anne
7efac187bd follow mame choice again
m68kmmu.h uses functions from m68kfpu.c which are static, so m68kfpu.c
can't be compiled alone anymore if we want to keep some basic
compatibility... I know, it's not super clean, but it's not my
choice...!
Also pmmu_translate_addr can't be inline anymore because of this (there
are quite a few functions from m68kcpu.h using it, and it can be
included only in m68kcpu.c !)
2019-12-13 13:40:42 +01:00
R. Belmont
530f644bd3 MC680x0 update
- Reworked PMMU/core interface so PMMU now sees all cop 0 instructions
 - Improved disassembly of PMMU instructions
 - Preliminary 68LC040 support
 - Fixed disassembly for EC/LC variants of '030/'040
2019-12-13 13:40:05 +01:00
R. Belmont
50baa65d4c 680x0 update: - Support PMOVE modes from PMMU - Allow the FPU to be used for both '030 and '040 - Add byte and word FPU loads/stores - Fixed buggy FPU 64-bit stores in the (An) addressing mode
If anyone has any ideas on how to sanely handle the 68k FPU's 96-bit "take
that, Intel" mode let me know ;-)
2019-12-12 21:24:43 +01:00
R. Belmont
d5576b3797 m680x0 update:
- Added working PMMU address translation (not feature complete, but sufficient
  to boot several 68030 Macs in MESS)
- Fixed up disassembly of some PMMU instructions
- Added "68020 with 68851" CPU type
2019-12-12 17:34:22 +01:00
Karl Stenerud
cb1c759428 Support MSVC noreturn 2019-11-04 18:56:29 +01:00
Karl Stenerud
b1cbb3ce68 Small fixes for MacOS 2019-11-03 21:53:34 +01:00
Karl Stenerud
8266fbe873 Removed INLINE and replaced it with static inline because it's part of the spec since c9x.
Beefed up the warnings and cleared them up.
m68kfpu.c is no longer included by m68kcpu.c.
Removed a bunch of internal function forward declarations, except for those used by macros.
Converted CRLF line endings to LF.
2019-11-03 19:33:07 +01:00
Emmanuel Anne
dbe9c95caf get rid of an unused variable 2019-09-06 13:26:42 +02:00
Emmanuel Anne
25e031e169 mame120: version update to 3.31 2019-09-04 23:21:26 +02:00
Emmanuel Anne
abc09c9056 cmpild, tas and rte callbacks (mame110) 2019-09-04 22:45:50 +02:00
Emmanuel Anne
a9a9bba50b fpu emulation mainly (from mame98 to mame106)
I removed the mame specific stuff from m68kfpu.c to make it portable
again
2019-09-04 21:15:31 +02:00