Commit Graph

11027 Commits

Author SHA1 Message Date
Legolas
a52e51d0b7 * Updated libndsfpc and nds linkerscript to Ver. 1.5.8
git-svn-id: trunk@28299 -
2014-08-02 15:23:51 +00:00
sergei
cf2b4a4dbd * softfpu cleanup: use Pascal boolean types where appropriate, use 64-bit overload of shift64RightJamming() to simplify things.
git-svn-id: trunk@28280 -
2014-07-30 23:39:10 +00:00
masta
66aca1b104 Optimize generic 64-bit division code
FPC_{DIV,MOD}_QWORD now check if both inputs have their upper 32bit set
to zero and in that case use 32-bit division instead, which many
plattforms can either do in hardware or have optimized assembly code
for.

git-svn-id: trunk@28279 -
2014-07-30 17:07:29 +00:00
Károly Balogh
1a4d6d79c5 new division helpers for ARM by Nico Erfurth. on our ARMv5 core hardware they're 22%-36% faster than the generic ones for the most common case.
git-svn-id: trunk@28273 -
2014-07-29 17:39:55 +00:00
Károly Balogh
88b58c3580 i386: added signed 64bit div/mod helpers in assembly. we have some 64bit heavy code where a direct helper results in about 8-10% of performance advantage compared to going through the generic wrapper + the unsigned function
git-svn-id: trunk@28261 -
2014-07-24 21:06:23 +00:00
sergei
ad2963783e * m68k-linux startup code:
+ initialize __stkptr variable (was missing, causing any stack check to fail)
 + non-executable stack marker.

git-svn-id: trunk@28249 -
2014-07-23 13:55:38 +00:00
nickysn
9a569b9e57 * use P/TTinyHeapMemBlockSize in RegisterTinyHeapBlock as well
git-svn-id: trunk@28248 -
2014-07-22 12:51:20 +00:00
nickysn
6f8a329b4c * use pointer arithmetic for doing address calculations, with a newly introduced
pointer type TTinyHeapPointerArithmeticType, instead of using ptruint. This
  will allow us to use a huge pointer in i8086 far data memory models, in order
  to allow the heap to exceed 64k.

git-svn-id: trunk@28247 -
2014-07-21 23:02:49 +00:00
nickysn
3b9ab33910 * added type TTinyHeapFreeBlockSize, which holds the size of a free memory block
in the tiny heap

git-svn-id: trunk@28246 -
2014-07-21 17:05:52 +00:00
nickysn
1dc09538d0 * introduce a type TTinyHeapMemBlockSize, which holds the size of an allocated
memory block in the tiny heap

git-svn-id: trunk@28245 -
2014-07-20 16:31:40 +00:00
marco
a4a11cb149 * startupinfo was declared with lpTstr. splitted in the usual A/W/- variants
git-svn-id: trunk@28240 -
2014-07-19 22:22:49 +00:00
marco
9c5e150965 * patch from #26485, haiku builds character units (and dependencies)
git-svn-id: trunk@28221 -
2014-07-15 10:27:22 +00:00
sergei
e65c4e13e0 * m68k: updated/fixed dllprt0.as, now able to link a shared library.
git-svn-id: trunk@28189 -
2014-07-09 22:59:13 +00:00
sergei
6bcaa88c3a * m68k: "or" without suffix is not accepted, must be "or.l"
git-svn-id: trunk@28184 -
2014-07-08 18:48:57 +00:00
sergei
cfe13734e0 * m68k: Fixed damage caused by r27573 and r28177:
* longjmp: restored loading of function result (d0) which got removed in r28177.
  * While at the point, added test for zero, because longjmp must never return zero values.
  * Assembler reader: 'fp' refers to frame pointer, not the stack pointer.

git-svn-id: trunk@28183 -
2014-07-08 15:04:54 +00:00
marco
3a7cde492e * finance functions by wp, mantis #26459
git-svn-id: trunk@28182 -
2014-07-08 12:45:11 +00:00
sergei
15ff2c1236 * m68k: Fixed name of ELF interpreter, and updated cprt0.as to somewhat working state. Now a "hello world" program using libc can be linked and launched, but anything more complex needs another round of fixing the parameter passing code, in order to get the stack properly balanced.
git-svn-id: trunk@28181 -
2014-07-07 20:08:50 +00:00
nickysn
16c5849fc6 + added HexStr() overload for huge pointers
git-svn-id: trunk@28180 -
2014-07-07 15:13:29 +00:00
nickysn
13646c7afe + added rtl helper for huge pointer subtraction
git-svn-id: trunk@28178 -
2014-07-06 19:15:14 +00:00
Károly Balogh
f98cd634fb m68k: reworked/cleaned setjmp/longjmp code to use the movem instruction with register lists
git-svn-id: trunk@28177 -
2014-07-06 13:18:56 +00:00
nickysn
4e2cc365d1 * while loop replaced with a repeat..until loop in InternalTinyFreeMem
git-svn-id: trunk@28161 -
2014-07-05 09:47:59 +00:00
nickysn
c306f48c14 + added rtl helpers for huge pointer comparisons
git-svn-id: trunk@28148 -
2014-07-04 08:34:17 +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
23a20f0e50 * m68k: fixed setjmp/longjmp:
* Data registers have to be saved/restored using 'move.l', because 'move' without suffix assumes 16-bit size.
  * setjmp must behave as a regular function w.r.t. removing its argument from the stack.

git-svn-id: trunk@28103 -
2014-07-01 11:46:10 +00:00
nickysn
f0346c096f + added rtl helpers for huge pointer arithmetic
git-svn-id: trunk@28099 -
2014-06-28 17:08:40 +00:00
sergei
12e0416323 * m68k-linux: now actually fixed syscall failure conditions.
git-svn-id: trunk@28092 -
2014-06-27 19:41:02 +00:00
sergei
4b4651d298 * m68k-linux: syscalls are expected to return -1 on failure, not -errno. This fixes some of the tests, webtbs/tw2494 is one of them.
git-svn-id: trunk@28089 -
2014-06-27 15:41:51 +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
nickysn
f7dd4f640a - rm the 'Memory allocation error' and 'Not enough memory' error messages from
the compact and large model startup code, since they're not used (we rely on
  the DOS loader to check for the available memory instead)

git-svn-id: trunk@28069 -
2014-06-25 23:16:55 +00:00
nickysn
ce4f9577d7 * seges prefix and lodsb instruction put on the same line for better readability
git-svn-id: trunk@28067 -
2014-06-25 21:07:25 +00:00
nickysn
2f83e2efc9 * use 'seges' instead of db 26h. It is actually supported, but for some reason,
unlike TP7's inline asm, in FPC it doesn't work on the same line as 'lodsb'.

git-svn-id: trunk@28065 -
2014-06-25 18:07:24 +00:00
nickysn
ec55340359 * i8086 far data memory model fixes in get_caller_addr and get_caller_frame
git-svn-id: trunk@28063 -
2014-06-25 16:47:56 +00:00
nickysn
ba5ececab9 * i8086 far data memory model fixes in the int 0 (div by zero) handler
git-svn-id: trunk@28062 -
2014-06-25 16:46:58 +00:00
nickysn
e7e02467fc * fixed bug in MsDos and Intr in i8086 far data memory models not cleaning their
parameters from the stack properly (leaving an extra word on the stack)

git-svn-id: trunk@28059 -
2014-06-25 12:33:03 +00:00
nickysn
47588a287d * ifdef i8086 changed to ifdef cpui8086 in dosh.inc, because that's part of the
rtl, not the compiler

git-svn-id: trunk@28058 -
2014-06-25 10:28:29 +00:00
nickysn
23b0cf2340 * msdos system unit variable dos_psp renamed PrefixSeg for TP7 compatibility
git-svn-id: trunk@28047 -
2014-06-24 10:58:59 +00:00
nickysn
1910177cf0 + added heapmax support to the $M directive on i8086-msdos. It is currently
only implemented in the near data memory models. The far data models support
  is still a TODO.

git-svn-id: trunk@28039 -
2014-06-23 20:17:17 +00:00
marco
bcd13a856d * Some convenience permission constants, patch by Graeme #26373
git-svn-id: trunk@28038 -
2014-06-23 15:35:43 +00:00
nickysn
95449a3fd4 * fixed yet another dos_psp<>dgroup bug in the startup code for .exe files in
the tiny memory model

git-svn-id: trunk@28033 -
2014-06-22 20:12:55 +00:00
nickysn
3164a10d9d * fixed a bug in the startup code for tiny memory model, which caused the
program MCB address not to be calculated correctly, when the program is a tiny
  model .exe file, leading to possible memory corruption. Previously, the code
  assumed that dos_psp=CS, but that's only true for tiny .com files; tiny .exe
  files have a 256-byte gap between dos_psp and CS.

git-svn-id: trunk@28032 -
2014-06-22 11:06:57 +00:00
nickysn
cd6b15f49a * slight optimization to the small and medium model startup code
git-svn-id: trunk@28031 -
2014-06-22 09:42:30 +00:00
Jeppe Johansen
0dc39b5d63 Applied patch from Michael Ring that adds some startup code for some new stm32f0 and stm32f1 controllers, and fixes naming on some LPC ARMv6m controllers.
git-svn-id: trunk@28009 -
2014-06-20 06:49:04 +00:00
nickysn
1295b4abf7 - removed the call to CheckNullArea from the exit code for the tiny memory model
git-svn-id: trunk@28006 -
2014-06-19 21:47:46 +00:00
michael
a0f4ff655e * Small optimisation in strnew from Luiz Americo (bug ID 26365)
git-svn-id: trunk@28005 -
2014-06-19 17:40:21 +00:00
nickysn
7cfd7a66cd + create a special 'heap' segment with reserved space equal to heapsize (i.e.
the value set by -Ch or the second parameter to the $M directive). This is
  equivalent to the heapmin value in Turbo Pascal 7 and ensures that the program
  has at least this amount of heap space available (otherwise DOS will show a
  'not enough memory' error and will refuse to load the program).

git-svn-id: trunk@28002 -
2014-06-19 14:14:01 +00:00
sergei
04d8e8a5dc * On 64-bit targets, handle abs(int64) internally, using the same code as for abs(longint), i.e. without branching. Both generic and x86-specific pass 2 code is already suitable for different operand sizes, only type checking needs removal of excessive conversions to 32 bits.
git-svn-id: trunk@27989 -
2014-06-17 18:45:11 +00:00
nickysn
2dc8839af5 * set class=data to all data segments/sections on i8086
git-svn-id: trunk@27957 -
2014-06-14 16:01:22 +00:00
nickysn
8ad63788c7 - do not emit a stack segment in the tiny memory model
- rm the reference to the top of the stack segment from the startup code in tiny
  model

git-svn-id: trunk@27956 -
2014-06-14 15:56:44 +00:00
nickysn
73d7f2aa18 * let the compiler generate the stack segment in i8086 near data memory models
as well. Even though, in these models, the stack is dynamically allocated
  (because it goes on top of the heap, but the heap is variable size), there are
  still benefits:
  1) the program will run on a larger stack during initialization, before the
     actual stack (and heap) are ready
  2) in cases, when the system is extremely low on memory, DOS will reject to
     load the program if there's not enough memory for the stack the program
     requires. This way the startup code can be further simplified by omitting
     the 'not enough memory' check in the future (when we add the minimum heap
     size to the executable reserved space as well).

git-svn-id: trunk@27903 -
2014-06-08 21:14:57 +00:00
Károly Balogh
e89669bedc rewrite SpinLock to still work without the need to accidentally disable optimizations for a large part of the classes unit
git-svn-id: trunk@27864 -
2014-06-06 11:05:57 +00:00