Commit Graph

82 Commits

Author SHA1 Message Date
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
sergei
29bf988ca7 + Implemented m68k-specific (actually, softfloat-specific) part of Math unit.
git-svn-id: trunk@27216 -
2014-03-21 05:24:09 +00:00
sergei
0255eb880e - Removed mathuh.inc files which are identical for all targets (except m68k, see below), their contents moved into math.pp.
+ m68k/mathu.inc: added stub implementations for missing functions.

git-svn-id: trunk@27180 -
2014-03-18 20:01:15 +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
652d69d145 fixed typo
git-svn-id: trunk@23269 -
2013-01-01 02:44:01 +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
79a0f706de save/restore FP from A5 on Amiga
git-svn-id: trunk@23267 -
2013-01-01 02:27:53 +00:00
svenbarth
e240856e43 * rtl/m68k/setjumph.inc:
data registers stored are 1 to 7, not 0 to 7
* rtl/m68k/setjump.inc:
    don't use "S" or "value" to reference the parameters as the code generator does not use "sp" instead of "fp" in case of "nostackframe"
    restore a0 at the end of setjmp

git-svn-id: trunk@23240 -
2012-12-28 13:00:28 +00:00
pierre
76ba2ea6c7 Save complete register set for setjmp/longjmp
git-svn-id: trunk@23174 -
2012-12-18 14:05:52 +00:00
pierre
0e14a3c5bd add fpc_longword_to_double if needed
git-svn-id: trunk@23173 -
2012-12-18 14:04:14 +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
a266d73409 * rtl/m68k/setjump.inc:
correctly dummy out setjump as "d0 <> 0" means that longjmp was executed (and d0 could be set from the calling function)

git-svn-id: trunk@22797 -
2012-10-21 13:56:48 +00:00
svenbarth
322dbe5b65 Various adjustments to the RTL for m68k:
* enable the 6 parameter syscall variant (still everything dummied out though)
* add termios constants
* don't change signal handlers for now
* disable assembly set routines as set handling was changed

git-svn-id: trunk@22743 -
2012-10-18 20:12:02 +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
svenbarth
6034866050 rtl/m68k: Added mathu(h).inc with dummy implementations of SetExceptionMask and GetExceptionMask
git-svn-id: trunk@22729 -
2012-10-18 20:10:48 +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
24fea58b92 + initial implementation of iso style gotos in iso mode
* made setjmp/longjmp accessible to the compiler by compiler proc, they are used by the iso goto code

git-svn-id: trunk@15711 -
2010-08-05 19:20:46 +00:00
florian
d127e002d8 * use default helpers for now
git-svn-id: trunk@5556 -
2006-12-07 20:44:52 +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
florian
cd81fa77ea + added currency and widestring support to TWriter and TReader 2004-05-23 12:42:42 +00:00
florian
91733f9237 * some m68k and amiga related stuff fixed 2004-05-05 21:26:34 +00:00
Jonas Maebe
6bd3eccdac + fpc_cpuinit procedure to allow cpu/fpu initialisation before any unit
initialises
  + fpu exceptions for invalid operations and division by zero enabled for
    ppc
2004-01-02 17:21:50 +00:00
carl
af2000b0f7 * make the jmp_buf record packed, just in case 2002-10-20 11:53:14 +00:00
peter
9f31783a0a * old logs removed and tabs fixed 2002-09-07 16:01:16 +00:00
peter
24384c648b * moved genrtti.inc code to rtti
* removed rttip.inc, the generic code is almost as fast and
    much easier to maintain and has less risks on bugs
2002-09-02 18:42:41 +00:00
michael
586c4cea50 + Conditionals fixed 2000-07-14 10:33:09 +00:00
michael
650fbb86aa + removed logs 2000-07-13 11:32:24 +00:00
michael
e7aca136a1 + Initial import 2000-07-13 06:29:38 +00:00
pierre
a41bd45aad * 0**n where n<>0 is 0; 0**0 generates RTE 207 2000-05-02 10:37:50 +00:00
daniel
ec29a31834 * copyright 2000 2000-01-07 16:41:28 +00:00
daniel
a79b4a404b * copyright 2000 added 2000-01-07 16:32:21 +00:00
carl
a166bd1bca * FillChar and FillObject bugfix, count was compared with byte 1998-10-17 14:34:37 +00:00
pierre
850e611770 * added code for vmt_offset in destructors 1998-10-16 13:37:45 +00:00