diff options
author | sergei <sergei@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2014-06-27 06:58:39 +0000 |
---|---|---|
committer | sergei <sergei@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2014-06-27 06:58:39 +0000 |
commit | fb51e1a0ea6a08cfd53e75e2c93acd972ff6a5ba (patch) | |
tree | ea22f8ee84cbaf714501bdd91a0ec7c0908ff3a2 /rtl/m68k | |
parent | d323c2c0a451821adfc5ec65960d3a973ba0bcdc (diff) | |
download | fpc-fb51e1a0ea6a08cfd53e75e2c93acd972ff6a5ba.tar.gz |
* 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: http://svn.freepascal.org/svn/fpc/trunk@28083 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl/m68k')
-rw-r--r-- | rtl/m68k/m68k.inc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/rtl/m68k/m68k.inc b/rtl/m68k/m68k.inc index f67ccf1280..3e796519d8 100644 --- a/rtl/m68k/m68k.inc +++ b/rtl/m68k/m68k.inc @@ -91,9 +91,7 @@ procedure FillChar(var x; count : longint; value : byte); assembler; asm move.l x, a0 { destination } move.l count, d1 { number of bytes to fill } -{ FIXME: this should be move.b, but everything is pushed as long on - the stack ATM (KB) } - move.l value, d0 { fill data } + move.b value, d0 { fill data } tst.l d1 { anything to fill at all? } ble @LMEMSET5 {$ifdef CPUM68K_HAS_DBRA} @@ -321,9 +319,7 @@ procedure FillWord(var x; count : longint; value : word); assembler; asm move.l x, a0 { destination } move.l count, d1 { number of bytes to fill } -{ FIXME: this should be move.w, but everything is pushed as long on - the stack ATM (KB) } - move.l value, d0 { fill data } + move.w value, d0 { fill data } tst.l d1 { anything to fill at all? } ble @LMEMSET3 bra @LMEMSET21 |