Commit Graph

72 Commits

Author SHA1 Message Date
Sven/Sarah Barth
e94d02a067 * with all existing RTLs switched over to the atomic intrinsics, the define FPC_SYSTEM_INTERLOCKED_USE_INTRIN can be removed again 2024-12-12 22:05:20 +01:00
Sven/Sarah Barth
a815beea2c * switch M68k RTL to provide atomic intrinsic helpers instead of Interlocked* functions 2024-12-12 22:05:16 +01:00
Rika Ichinose
ce5a632432 Remove the rest of the VER3_0 conditionals. 2024-09-01 17:13:39 +00:00
Jonas Maebe
0758aa1143 FPU exception mask: generlised system unit interface 2022-10-17 19:43:01 +00:00
Pierre Muller
870d612e15 Fix compilation of m68k-linux rtl with -dFPC_USE_LIBC 2022-06-08 00:20:57 +02:00
Karoly Balogh
ecef61e9c5 * m68k: fix an instruction which doesn't exist on ColdFire 2022-02-12 17:32:59 +01:00
Karoly Balogh
12ef9a4a22 * m68k: some CPUs don't have TAS either (for example some CF) 2022-02-11 01:53:19 +01:00
Karoly Balogh
3c5d6e7224 * m68k: implement basic support for interlocked functions using a TAS based global spinlock on CPUs which don't have the CAS instruction 2022-02-08 04:42:30 +01:00
svenbarth
00141749d5 * Coldfire does not support sub.w, so use sub.l instead for that CPU
git-svn-id: trunk@38041 -
2018-01-25 19:56:28 +00:00
Károly Balogh
8326543918 m68k: apparently, the right place for the sar qword helper is still in the CPU include, not the 64bit helper include. this fixes linux m68k build.
git-svn-id: trunk@37820 -
2017-12-26 18:05:34 +00:00
Károly Balogh
e1501c86bf m68k: fix no FPU support
git-svn-id: trunk@37227 -
2017-09-16 18:13:57 +00:00
Károly Balogh
f4a8a29aea m68k: try to restore compilability with a 3.0 compiler
git-svn-id: trunk@37026 -
2017-08-22 09:05:20 +00:00
svenbarth
2c628e983d * fix define so that m68k for Coldfire builds correctly again
git-svn-id: trunk@36688 -
2017-07-08 20:29:25 +00:00
Károly Balogh
17e85c4a09 m68k: rewritten FillChar from scratch. does aligned word and dword writes on large block fills. depending on the host CPU it's up to 5x faster on medium and large block fills
git-svn-id: trunk@36631 -
2017-07-03 19:22:51 +00:00
Károly Balogh
2d8313165d m68k: support FFU exception settings, also reworked FPU initalization
git-svn-id: trunk@36618 -
2017-06-30 02:38:14 +00:00
Károly Balogh
30176f3116 m68k: enable inlined get_frame for m68k
git-svn-id: trunk@36577 -
2017-06-22 17:43:24 +00:00
Károly Balogh
238f423c71 m68k: implement the interlocked family of functions, to be used on Linux and BSDs
git-svn-id: trunk@36557 -
2017-06-21 01:02:49 +00:00
Károly Balogh
35ddac66fc m68k: fix frame pointer register on atari, and a few other non-amiga systems
git-svn-id: trunk@35204 -
2016-12-27 17:09:06 +00:00
Károly Balogh
7d2360eb0c m68k: Test68000/Test68881 support boilerplate and special support for Amiga
git-svn-id: trunk@35194 -
2016-12-24 21:11:06 +00:00
Károly Balogh
391a79aebf m68k: a bunch of tweaks and improvements to assembly functions. higher move() speed on coldfire, disabled fillword implementation on CPUs not supporting unaligned access
git-svn-id: trunk@33805 -
2016-05-25 22:44:18 +00:00
Károly Balogh
846dd6b57b m68k: use the Amiga-specific atomic ops on Amiga
git-svn-id: trunk@30903 -
2015-05-24 21:44:51 +00:00
Károly Balogh
49f3473735 fixed the define around the FPU code
git-svn-id: trunk@30695 -
2015-04-21 17:05:43 +00:00
Károly Balogh
7758ad9313 m68k: clear the FPU Control Register at program start. This fixes some testcode randomly failing on AmigaOS, where the FPCR state is inherited from the parent task. Also added the FPCR layout and rounding modes info, based on the Motorola 68k PRMm68k.inc
git-svn-id: trunk@30060 -
2015-03-02 00:51:23 +00:00
Károly Balogh
f2c7a3efbf m68k: some assembler SwapEndian() implementations I did a while back. disabled for now, because they weren't extensively tested and benchmarked
git-svn-id: trunk@29380 -
2015-01-04 01:39:49 +00:00
sergei
38d5be4182 + Comment about behavior of DBRA instruction
git-svn-id: trunk@29321 -
2014-12-25 09:32:10 +00:00
sergei
e232dd5066 + m68k: default implementation of fpc_cpuinit, provides correct masking of floating-point exceptions and fixes test/testv8.pp.
git-svn-id: trunk@28128 -
2014-07-02 16:23:40 +00:00
sergei
acd3ea8750 * m68k: Fixed parameter passing to conform to ABI:
* records are passed by value
  * records with size of 1,2 or 4 are returned in registers
  * parameters with size<4 are justified on the stack according to big-endian target

Now everything except floating-point parameters is compatible with C code compiled with "-malign-int -mrtd".
Compatibility with "-mno-align-int" is achievable by changing target_info.maxCrecordalign to 2, but doings so causes a lot more troubles because RTL (incorrectly) assumes that records declared with {$PACKRECORDS C} are aligned to pointer size.

+ Reuse parameter locations. Since everything is passed on stack, it reduces code size quite a bit.
- tm68kparamanager.getintparaloc removed, generic implementation has been tested and works as expected.

git-svn-id: trunk@28083 -
2014-06-27 06:58:39 +00:00
sergei
217ab9879c * Enabled internal handling of Abs(longint) for all targets. It has been implemented in cross-platform way ages ago (see tcginlinenode.second_abs_long), but not enabled on MIPS,SPARC and m68k.
- RTL: removed MIPS,SPARC and m68k-specific implementations of Abs(longint), and marked the generic one as  required for bootstrapping purposes only.

git-svn-id: trunk@27857 -
2014-06-05 10:35:51 +00:00
Károly Balogh
50c59a1cc2 don't try to fillchar/move by a negative amount, fixes tmem test
git-svn-id: trunk@26827 -
2014-02-22 03:30:58 +00:00
Károly Balogh
e27db65085 really fixed FillChar and fixed FillWord. fixes 8 tests.
git-svn-id: trunk@25621 -
2013-10-02 12:33:52 +00:00
svenbarth
83f4344c20 Fix around 30 tests for m68k by fixing FillChar:
* completely disable the DBRA part for CPUs without DBRA
  * replace CMP/BNE with BPL which uses the flags of the SUB instruction
Additional fixes for the other two (still disabled) DBRA alternatives:
  * use BPL instead of BMI (which is wrong)

git-svn-id: trunk@25587 -
2013-09-27 20:57:55 +00:00
svenbarth
dfb0c7da24 Forgot to commit this the last time: Use CPUM68K_HAS_DBRA instead of CPUCOLDFIRE (which does not exist anymore).
git-svn-id: trunk@25586 -
2013-09-27 20:54:54 +00:00
svenbarth
83af4e93f7 rtl/m68k/m68k.inc:
* InterlockedIncrement & InterlockedDecrement: return the modified value, not the original one

git-svn-id: trunk@23432 -
2013-01-17 21:19:27 +00:00
svenbarth
f5e94a02cd rtl/m68k/m68k.inc:
* fillchar & fillword: check whether the count is 0 before filling anything

This fixes cases like "Writeln('')" which is used inside InternalExit if an unhandled exception happened.

git-svn-id: trunk@23431 -
2013-01-17 21:17:13 +00:00
Károly Balogh
0702109f37 get_frame to return a5 on Amiga
git-svn-id: trunk@23268 -
2013-01-01 02:37:39 +00:00
Károly Balogh
e2f02faca0 do not refer reg a6 directly, base pointer might differ among platforms (a5 on m68k-amiga)
git-svn-id: trunk@23167 -
2012-12-18 02:13:43 +00:00
svenbarth
4d1e42e891 rtl/m68k/setjump.inc:
* implement "fpc_setjmp" and "fpc_longjmp"
rtl/m68k/m68k.inc:
  * add "nostackframe" to "get_frame" and "sptr"
  + add "get_pc_addr"
=> allows stack traces to be displayed correctly

git-svn-id: trunk@22899 -
2012-11-01 16:00:14 +00:00
svenbarth
fb873d6f02 rtl/m68k/m68k.inc:
dummyplement Interlocked* functions; they are not locking in any way, but at least they do what they should

git-svn-id: trunk@22884 -
2012-10-31 06:24:08 +00:00
svenbarth
f204f84f6a rtl/m68k/m68k.inc, move:
completely disable the "fast loop" code for Coldfire instead of "hackfixing" it; with this StdIO starts to work (though one byte is missing at the end...)

git-svn-id: trunk@22883 -
2012-10-31 06:10:03 +00:00
svenbarth
58d9b0853c * rtl/m68k/m68k.inc, move:
add a check for "count = 0" which happens e.g. inside of System.Assign if called with '' as filename (which is the case inside OpenStdIO)

git-svn-id: trunk@22841 -
2012-10-24 05:03:08 +00:00
svenbarth
43d8da7aa3 Replace DBRA instruction for Coldfire with a SUB/BRA combination in the for-loop-code-
generation and the assembly helpers in the RTL as DBRA is not supported by Coldfire.

git-svn-id: trunk@22740 -
2012-10-18 20:11:45 +00:00
pierre
8469741700 + Added additional addr pointer parameter to
get_caller_frame, get_caller_addr and dump_stack
  with default NIL value to systemh.inc.
  + Added new get_addr function.
  system.inc: Use get_addr and get_frame to call
  HandleErrorAddrFrame instead of HandleErrorFrame
  in several error functions.
  Modify dump_stack to use frame and addr parameters.
  Provide a dummy get_addr function returning nil.
  i386/i386.inc, x86_64./x86_64.inc: Provide real
  implementation of get_addr function.

git-svn-id: trunk@21697 -
2012-06-24 21:22:09 +00:00
florian
b07cd83892 * made system unit on m68k-linux compilable
git-svn-id: trunk@5266 -
2006-11-06 18:42:47 +00:00
Károly Balogh
572c8430ac + more mess to make the skeleton amiga rtl compile
git-svn-id: trunk@2393 -
2006-02-01 15:35:33 +00:00
Jonas Maebe
5b9f58ef73 * reverted r2037 because of braindead "out" semantics for refcounted
types

git-svn-id: trunk@2045 -
2005-12-24 01:06:05 +00:00
Jonas Maebe
84aab46550 * changed formal "var" paramters of move, movechar0 and fill* into
"out" parameters to avoid wrong "uninitialized" warnings

git-svn-id: trunk@2037 -
2005-12-23 20:59:08 +00:00
peter
4ace790492 * remove $Log
git-svn-id: trunk@231 -
2005-06-07 09:47:55 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00