Commit Graph

156 Commits

Author SHA1 Message Date
Jeppe Johansen
53fd543440 Fix fillchar for >ARMv3
git-svn-id: trunk@31573 -
2015-09-07 20:25:03 +00:00
Jeppe Johansen
dac294c680 Fix ARMv3/ARMv2A support.
git-svn-id: trunk@31561 -
2015-09-06 20:33:26 +00:00
Jeppe Johansen
44ad5af04d Fix some minor UMULL, and FPv4_S16 define problems
git-svn-id: trunk@31560 -
2015-09-06 20:14:16 +00:00
Jeppe Johansen
3ef4033e7d Test the proper CPUARM capability when chosing between blx and bl.
git-svn-id: trunk@30273 -
2015-03-22 13:42:28 +00:00
Jeppe Johansen
9478099e5a Undo recent VFP assembler changes to make bootstrapping from 3.0.1 possible.
git-svn-id: trunk@30183 -
2015-03-14 10:04:17 +00:00
Jeppe Johansen
914e9e7b49 Merged from trunk
git-svn-id: branches/laksen/armiw@30146 -
2015-03-08 12:33:46 +00:00
florian
9eab90d8c4 * always pass the architecture to the arm assembler
* encode pld/ldrd in arm.inc using .long, so it causes no errors with older architectures settings of the assembler

git-svn-id: trunk@29780 -
2015-02-21 21:58:30 +00:00
Jeppe Johansen
ff7af306df Add FPA support.
git-svn-id: branches/laksen/armiw@29366 -
2015-01-01 11:18:04 +00:00
Jeppe Johansen
71cdedea82 Add missing NOP, and B instruction forms.
Move ThumbFunc flag from section to symbol.
Make .w forms optional the other way around. If .w is explicitly put on an instruction the assembler should always chose a wide form.

git-svn-id: branches/laksen/armiw@29341 -
2014-12-27 13:23:02 +00:00
Jeppe Johansen
9e5979e8be Implemented UAL syntax support in the ARM assembler reader. Can be toggled with a field for now, but not implemented yet. Still using pre-UAL syntax for now.
Switched codegeneration of VFPv2 and VFPv3 to use UAL mnemonics and syntax.
Updated VFP code in RTL to use UAL syntax too.
Added preliminary ELF support for ARM.
Added support for linking of WinCE COFF files. Should work for with a standard ARMv4-I target.

git-svn-id: branches/laksen/armiw@29247 -
2014-12-10 20:44:34 +00:00
Jeppe Johansen
d4461efae3 Fix broken ldrd assembler syntax in RTL
git-svn-id: trunk@29187 -
2014-11-30 17:30:46 +00:00
florian
03c553606e - unneeded spaces removed
git-svn-id: trunk@28740 -
2014-10-04 13:45:17 +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
sergei
a94187c79b - ARM: cleaned out code corresponding to FPC_STRTOSHORTSTRINGPROC not defined (obsolete and removed from other targets long ago).
git-svn-id: trunk@27831 -
2014-05-31 00:38:01 +00:00
sergei
fff45fa1d3 - Don't compile fpc_abs_real and fpc_sqr_real if they are already defined (Mantis #25342).
git-svn-id: trunk@27408 -
2014-03-31 10:10:04 +00:00
sergei
8ad5e6fb26 - RTL: cleaned out FPC_FREEMEM_X. We now have a dedicated compilerproc 'fpc_freemem' for this purpose.
git-svn-id: trunk@27232 -
2014-03-23 02:11:38 +00:00
sergei
67a8c315d8 * ARM: SetExceptionMask and SetRoundingMode must return the old value of mask/mode respectively, not the new one.
git-svn-id: trunk@27217 -
2014-03-21 06:03:00 +00:00
sergei
94a045aa3d * Moved declarations of TFPURoundingMode,TFPUExceptionMask and TFPUPrecisionMode to System unit. Declarations in Math unit changed to aliases.
* Changed type of softfloat_exception_mask and softfloat_exception_flags to TFPUExceptionMask, softfloat_rounding_mode to TFPURoundingMode.
- Cleaned out numerous conversions happening when getting/setting exception mask and rounding mode.

git-svn-id: trunk@27215 -
2014-03-20 22:44:46 +00:00
sergei
7b56c90d82 - MIPS,SPARC and ARM-wince: removed remaining references to softfloat stuff.
git-svn-id: trunk@27204 -
2014-03-20 17:46:01 +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
florian
7c606ba34c * generate rfs/wfs for thumb2 only if an fpa fpu is used
git-svn-id: trunk@27100 -
2014-03-11 21:20:49 +00:00
florian
6e32f8ee8f * patch by Bernd which fixes InterLockedxxx functions on ARMv4T, resolves #25518
git-svn-id: trunk@26792 -
2014-02-16 09:10:00 +00:00
Károly Balogh
c108a24cc8 reverted r25622 which was an accidental commit of some highly experimental debug code (sorry)
git-svn-id: trunk@25623 -
2013-10-02 18:31:28 +00:00
Károly Balogh
d004b44406 really fixed FillChar and fixed FillWord. fixes 8 tests.
git-svn-id: trunk@25622 -
2013-10-02 14:11:09 +00:00
svenbarth
7babce23da Fix compilation of arm-wince on Linux(?).
rtl/arm/arm.inc & setjump.inc:
  * don't use BX if the current CPU (default for arm-wince is ARMv3)  does not support it

git-svn-id: trunk@25393 -
2013-09-01 14:05:48 +00:00
florian
c0dda2ab77 * disable assembler versions of string routines for arm thumb
git-svn-id: trunk@23998 -
2013-03-25 17:54:32 +00:00
florian
97f21a7210 + fpc_cpucodeinit for arm thumb
git-svn-id: trunk@23984 -
2013-03-24 20:24:42 +00:00
florian
21c154d60a Merged r22903
git-svn-id: trunk@23757 -
2013-03-09 20:56:07 +00:00
florian
1eeeb309c7 * intial armv6m support, it is not working yet, constant pool insertation and conditional branch fixup is not working yet
git-svn-id: trunk@23682 -
2013-03-03 12:20:10 +00:00
florian
5af646d1d2 + add missing it* statements for thumb2 by a modified patch of Jeppe Johansen, resolves #23738
git-svn-id: trunk@23540 -
2013-01-29 20:36:38 +00:00
Jeppe Johansen
3ee29eb219 Fixed ARMv7-EM code generation and RTL compilation
Added LM4F120H5 controller type and startup code

git-svn-id: branches/laksen/arm-embedded@22903 -
2012-11-01 17:25:01 +00:00
tom_at_work
5647d5112b Fixed error in define selecting write barrier code that has been introduced during debugging
git-svn-id: trunk@22872 -
2012-10-29 08:33:31 +00:00
tom_at_work
3d0dd28350 Improve memory barriers on ARM
- memory barriers are only needed on armv6 and up
 - DMB on ARMv6 is "mcr 15, 0, r0, cr7, cr10, {5}", not "mcr 15, 0, r0, cr7, cr10, {4}"
 - improve write barrier on armv7 by using "dmb st" instead of "dmb sy"
todo: The use of the correct barrier code should be determined during runtime.

git-svn-id: trunk@22867 -
2012-10-28 19:38:36 +00:00
tom_at_work
312e8b8ecc Add implementations for read/write barrier code for ARM
git-svn-id: trunk@22864 -
2012-10-27 22:53:44 +00:00
Jeppe Johansen
4e84431dde Fix some optimizations which assume that there are 3 operands
Add simple Mul+Sub/Mul+Add into MLS/MLA optimizations
Fix some other small issues in the optimizer
Implement Interlocked* functions with proper use of LDREX/STREX

git-svn-id: branches/laksen/arm-embedded@22801 -
2012-10-21 16:20:52 +00:00
Jeppe Johansen
a8f9b0dac4 Added initial support for the Cortex-M4F FPv4_S16 FPU
git-svn-id: branches/laksen/arm-embedded@22597 -
2012-10-08 20:10:45 +00:00
florian
1bb6248186 * disable hand optimized assembler for arm thumb2 as well
git-svn-id: trunk@22313 -
2012-09-04 14:29:52 +00:00
florian
86a6cee8fa - removed due to BSD license header
git-svn-id: trunk@22286 -
2012-09-02 20:46:58 +00:00
Jonas Maebe
2dbe48a76c * extra "addr" parameters for get_caller_addr/frame (patch by
Jeppe Johansen, mantis #22727)

git-svn-id: trunk@22252 -
2012-08-26 19:07:36 +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
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
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
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
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