Commit Graph

9703 Commits

Author SHA1 Message Date
pierre
4ecd67f6e2 * Use gsed if present and temp directory to avoid system recompilation
git-svn-id: trunk@22169 -
2012-08-22 09:43:34 +00:00
michael
a110490a5e * Added slice dummy
git-svn-id: trunk@22154 -
2012-08-20 22:57:29 +00:00
florian
62eed2e3f2 * function round(c : currency) : int64; requires the availability of an fpu
git-svn-id: trunk@22149 -
2012-08-20 20:15:07 +00:00
florian
088a7229aa * use ValSInt parameter as code parameter in val calls to make the code cross platform
git-svn-id: trunk@22148 -
2012-08-20 20:12:04 +00:00
florian
04034b6771 * avr uses a reduced buffer and file name length in textrecs and filerecs
* fixed file and text sizes for avr

git-svn-id: trunk@22147 -
2012-08-20 20:11:13 +00:00
florian
7201bd8526 + sincos implemenation for x86-64
git-svn-id: trunk@22142 -
2012-08-19 22:36:59 +00:00
florian
1da4c0c3ce * SinCos overloads added, resolves #22663
git-svn-id: trunk@22139 -
2012-08-19 22:09:03 +00:00
masta
13e2572140 Remove unnecessary compiler version checks in rtl/arm/arm.inc
The CPUARM_HAS_* flags are never defined in 2.6, so there is no reason
to check for the compiler version.

git-svn-id: trunk@22128 -
2012-08-19 15:51:44 +00:00
Jonas Maebe
060e3ed4ee * changes from r21697, 21707, 21843, 21861, 21701, 21887, 21899 and 21900
to systemh.inc/system.inc/compproc.inc 'merged' into as of yet still
    JVM-specific copies of those files

git-svn-id: trunk@22125 -
2012-08-19 13:51:15 +00:00
Jonas Maebe
504544e173 * fixed null-termination in StringToWideChar() if the buffer is larger than
the string (mantis #22669)

git-svn-id: trunk@22124 -
2012-08-19 13:48:02 +00:00
Jonas Maebe
c29e6bbcb8 * disabled assembler implementations of fpc_ansistr_decr_ref/
fpc_ansistr_incr_ref for Darwin/ARM: they don't follow the Darwin/ARM
    ABI for function calls, the code already contains enough ifdefs and
    I don't want to spend time on maintaining OS-specific assembler
    implementations

git-svn-id: trunk@22121 -
2012-08-19 09:37:07 +00:00
florian
c64b400764 * fix Makefile to work with make 3.82 by adding missing compiler commands
git-svn-id: trunk@22118 -
2012-08-17 20:33:09 +00:00
florian
312984cb4f * ifdef blx InterlockedExchange correctly
git-svn-id: trunk@22117 -
2012-08-17 20:30:19 +00:00
masta
6729164fcc Work around load latency in InterlockedExchange for ARM
An LDR will have two load latency cycles on most ARM implementations,
moving the
  mov r4, r0
two instructions away from the corresponding ldr will avoid the stalls.

git-svn-id: trunk@22107 -
2012-08-17 12:42:49 +00:00
florian
e353222a8a * if the selected cpu type supports pld, provide and use only the pld variant
git-svn-id: trunk@22105 -
2012-08-17 10:37:36 +00:00
tom_at_work
38226169a9 Make use of "blx" instruction in fpc_ansistr_dec_ref conditional on CPUARM_HAS_BX, otherwise just use the "bl" instruction. Bug introduced in r22035. Fixes bug report 22632.
git-svn-id: trunk@22102 -
2012-08-17 08:28:08 +00:00
florian
e6efbd36ad * compiler defined cpuflags instead of creating them during system unit compilation
git-svn-id: trunk@22091 -
2012-08-15 15:49:11 +00:00
tom_at_work
f252fd369e Tried to reorganize the ARM define mess in rtl/arm/arm.inc. Instead of requiring to enumerate all possible ARM variants each time a CPU feature is used, add a define of the format CPUARM_HAS_XXX and use that. Note that a better solution would be to properly implement the compiler cpuinfo infrastructure, however that is much more work.
+ CPUARM_HAS_BX is defined if the CPU supports the BX* instruction
  + CPUARM_HAS_REV is defined if the CPU supports the REV instruction. Note that you still have to check for compiler versions > 2.6.0 since the assembler reader of 2.6.0 does not understand that instruction.
  + CPUARM_HAS_IDIV is defined if the CPU supports the sdiv, udiv instructions. Use of this fixes a bug where previously these instruction were only used for armv7-m, while cortex3m cpus also support it.
  + CPUARM_HAS_LDREX is defined if the CPU supports the ldrex/strex instructions. Use of this fixes a bug with armv7(-a) cpus where this path has not been used.
  + SYSTEM_HAS_KUSER_CMPXCHG is defined if the system (mainly OS) support the kuser_cmpxchg functions. Use of this fixes a bug where ARMHF systems did not use it for synchronization (although ARMHF is armv7+ only, i.e. the LDREX path is used anyway)

git-svn-id: trunk@22081 -
2012-08-14 19:45:03 +00:00
marco
b822371d41 * add platform modifiers to all locally defined functions in unix' dos unit.
git-svn-id: trunk@22069 -
2012-08-13 10:14:07 +00:00
svenbarth
3ad324ad13 Removed x86 unit from the Makefile.fpc (it's a Unix only unit) and regenerated Makefile.
git-svn-id: trunk@22066 -
2012-08-12 13:53:55 +00:00
tom_at_work
9a82fb9eb4 Fix InterlockedExchange for non-armv6+ ARMV processors. Original InterlockedExchange was not atomic in regards to the other Interlocked* functions, leading to crashes if they were used.
Instead of directly using "swp" in InterlockedExchange, use
 - kuser_cmpxchg if available (on Linux/armel)
 - the fpc global mutex (fpc_system_lock) otherwise
to implement it.

git-svn-id: trunk@22062 -
2012-08-11 19:32:11 +00:00
florian
49246b6263 * make textrec/filerec unpacked, this improves the code significantly on arm etc.
git-svn-id: trunk@22057 -
2012-08-10 21:17:50 +00:00
sergei
393f1d58ed * Fixed register rsi being overwritten. It is used to pass argc into libc_start_main.
git-svn-id: trunk@22043 -
2012-08-09 07:34:49 +00:00
sergei
12dc48afbf * Set errno using a call to seterrno, like it is done for i386 target. This removes most of assembler code together with PIC hacks and makes this part independent of threadvar implementation details.
git-svn-id: trunk@22042 -
2012-08-09 06:34:00 +00:00
florian
2fc350eabd * the reference counter offset depends only on the current rtl, not the compiler version, so no ifdef needed
git-svn-id: trunk@22038 -
2012-08-08 18:59:19 +00:00
masta
51af7bd440 Assembly version of fpc_ansistr_incr_ref for ARM
Optimized to minimize load latency and icache usage. Together with the
previous fpc_ansistr_decr_ref optimization this little test programm
runs about 40% faster.

  program stringspeed;

  procedure test(s:string);
  begin
  end;

  var
    s:string;
    i: cardinal;
  begin
    s:='abcd';
    for i:=0 to $FFFFFF do
      test(s);
  end.

Even with s:='' it's about 30% faster.

git-svn-id: trunk@22035 -
2012-08-08 15:29:26 +00:00
masta
b9770519f8 Assembly version of fpc_ansistr_decr_ref for ARM
As fpc_ansistr_decr_ref is a very often called procedure in typical
pascal programs this optimized version will shave off some cycles
compared to the generic one.

It tries to avoid load latencies as much as possible and also uses the
new Z-flag functionality of the InterlockedDecrement from the previous
patch. Also FreeMem is called as a tail-function.

git-svn-id: trunk@22034 -
2012-08-08 06:44:31 +00:00
masta
25e2f5f3fa Small improvement to InterlockedExchange on ARM
Use movs instead of mov when setting the result in r0. This way the Z
flag will be set for the calling function which might allow some smaller
optimizations later on. It does not affect current code in any way,
because flags are not expected to be used across function calls.

git-svn-id: trunk@22033 -
2012-08-08 06:44:26 +00:00
masta
e4a719fcff Fix ARM SwapEndian on armv6+ for compilation with FPC 2.6
We're currently using rev for armv6+, but FPC 2.6 could not handle the
instruction. So if somebody wants to build trunk it can't be for armv6+.

We'll circumvent the problem by always using the the generic code when
build with FPC 2.6.

git-svn-id: trunk@22003 -
2012-08-03 22:38:07 +00:00
florian
291157330e * fix setjump for arm<=armv5 with vfp
git-svn-id: trunk@22002 -
2012-08-03 22:04:22 +00:00
marco
666fecb6df * workaround for unsupported construct in fpdoc. (enum declared nested in class)
git-svn-id: trunk@21999 -
2012-08-02 13:01:27 +00:00
masta
2e0203b7a2 Improved Move implementation on ARM
This adds some small improvements to Move_pld and Move_blended.

1.) Overlapping memory is handled as "unusual" and the code is placed at
the end of the function for better icache/bpu performance
2.) Fused the overlap check into 3 instructions with a single jump
instead of 5 instructions with 2 jumps.
2.) Use ldmia/stmia with 2 registers instead of ldr/str for faster
copying.
3.) Some code cleanup

git-svn-id: trunk@21992 -
2012-08-01 11:15:20 +00:00
paul
1af45d7ec0 rtl: don't perform unneeded string conversions if string codepage matches codepage to convert (thanks to Sergey)
git-svn-id: trunk@21987 -
2012-07-31 01:24:36 +00:00
florian
df83d96559 + patch by CA Gorski adding missing 'kernel32' strings
git-svn-id: trunk@21982 -
2012-07-29 10:34:03 +00:00
Jonas Maebe
93c345a099 * always decrease the refcount of the function result of helpers that return
interfaces (since that may not have been done yet in case of an optimized
    assignment before r21955, and will never be done as of r21955)

git-svn-id: trunk@21962 -
2012-07-23 23:54:44 +00:00
masta
f354651180 Fix ARM FPU Exceptions for WinCE
r21952 introduced wrong code (through copy&waste) for the wince
exception-setup routines.

This patch hopefully fixes the code again.

git-svn-id: trunk@21961 -
2012-07-23 22:58:02 +00:00
florian
c2eb030632 * for proper alignment in arrays of text, text should be a multiple of 4 in size on 32 bit platforms
git-svn-id: trunk@21956 -
2012-07-23 19:12:27 +00:00
masta
386738a7c3 Fix ARM FPU exception masks
This corrects the handling of exception masks and ARM VFP
implementations. The old code enable the exception when it was present
in the mask. So in fact it did the contrary of what it was supposed to
do.

VFP-Support is currently broken, this patch at least allows to build a
working VFP-native compiler. But the full build still breaks because of
some compiler options not properly beeing passed down to packages/ which
results in:

"Trying to use a unit which was compiled with a different FPU mode"

because somehow OPT="-Cfvfpv2" did not get passed down.

git-svn-id: trunk@21952 -
2012-07-23 07:26:57 +00:00
masta
109eb8bf75 Add a couple of ARM Linux syscalls
This adds the following syscalls from Linux 3.5.0:

syscall_nr_preadv
syscall_nr_pwritev
syscall_nr_rt_tgsigqueueinfo
syscall_nr_perf_event_open
syscall_nr_recvmmsg

git-svn-id: trunk@21951 -
2012-07-22 22:58:16 +00:00
michael
252c2bbc83 * FormatMessageA -> FormatMessage (W version)
git-svn-id: trunk@21937 -
2012-07-18 09:17:30 +00:00
michael
8a9bd38cd7 * Copied non-sysutils solution of win32/64
git-svn-id: trunk@21936 -
2012-07-18 07:38:21 +00:00
michael
78bfc145c1 * No SysErrorMessage on WinCE ?
git-svn-id: trunk@21935 -
2012-07-18 07:36:24 +00:00
florian
0e9139c914 * retrieve stack size correctly
git-svn-id: trunk@21928 -
2012-07-17 20:14:15 +00:00
florian
f6f6df2780 * removed line breaks
git-svn-id: trunk@21927 -
2012-07-17 20:13:21 +00:00
florian
a6a1f2a0a1 * properly retrieve the stacktop on win64
git-svn-id: trunk@21926 -
2012-07-17 19:47:35 +00:00
Jonas Maebe
6cc78635d7 * send full x/y ansi position information in case of an X-coordinate
overflow (don't know what the y-coordinate is at that point, because the
    window may be  wider than the artificial screenwidth) (mantis #20880)

git-svn-id: trunk@21925 -
2012-07-17 18:03:23 +00:00
florian
a5754ed02b * more robust get_caller_frame and get_caller_addr for win32 which has always a valid StackTop value
git-svn-id: trunk@21919 -
2012-07-15 21:36:06 +00:00
florian
25b80bedf9 * get rid of tabs with wrong size
git-svn-id: trunk@21913 -
2012-07-15 14:04:50 +00:00
florian
3d76823929 * load StackTop and StackBottom correctly on windows, also in libraries
git-svn-id: trunk@21912 -
2012-07-15 14:03:45 +00:00
Tomas Hajny
2bcfe75ea8 * correction for copy&paste error in previous commit
git-svn-id: trunk@21908 -
2012-07-12 23:32:51 +00:00