Commit Graph

1241 Commits

Author SHA1 Message Date
florian
684ef3008f * ARM: optimize mov rX,#0 .... mul/mla/umull ...,rX,...
git-svn-id: trunk@44242 -
2020-02-24 21:10:55 +00:00
Jonas Maebe
592df7fa59 * disable cs_opt_regvar on all platforms when compiled for LLVM (LLVM does
that itself, our LLVM code generator can't handle it, and if it did then
    afterwards we would have to spill 90% of those register variables again
    to make them SSA)

git-svn-id: trunk@44062 -
2020-01-29 22:21:07 +00:00
florian
7b4292c94e * patch by Robert Roland to support the RaspberryPi 2 as a bare metal embedded target, resolves #35236
git-svn-id: trunk@44027 -
2020-01-23 21:14:49 +00:00
florian
d409548842 -- Zusammenführen von r31198 in ».«:
C    compiler/arm/aasmcpu.pas
U    compiler/arm/aoptcpu.pas
-- Aufzeichnung der Informationen für Zusammenführung von r31198 in ».«:
 U   .

git-svn-id: trunk@43825 -
2019-12-31 13:28:03 +00:00
Jonas Maebe
1a9e246c29 * added is_normal_fieldvarsym() helper and use it
o fixes several places where there was a check whether something is a
     fieldvarsym, but not whether it's an instance rather than a class field

git-svn-id: trunk@43786 -
2019-12-24 22:12:44 +00:00
Jonas Maebe
1e3f72403e * renamed getintparaloc to getcgtempparaloc
o it can be used for more than integer parameters

git-svn-id: trunk@43781 -
2019-12-24 22:12:25 +00:00
florian
a20209e691 + tf_init_final_units_by_calls
* arm-embedded generates direct calls for unit init/final now as well

git-svn-id: trunk@43771 -
2019-12-24 16:14:30 +00:00
florian
ef87879402 * common naming for fpu_none string
git-svn-id: trunk@43768 -
2019-12-24 16:14:28 +00:00
florian
2a315df80c * check in CheckLive* if a register allocator is initialized for a certain register type
git-svn-id: trunk@43665 -
2019-12-08 22:22:17 +00:00
florian
da54d0e8f7 + patch by J. Gareth Moreton: new method TAOptObj.CanDoJumpOpts and arm specific implementation
git-svn-id: trunk@43519 -
2019-11-20 22:12:27 +00:00
florian
e1e8986462 * patch by J. Gareth Moreton, issue #36271, part 3: support for the other architectures
git-svn-id: trunk@43441 -
2019-11-10 16:11:40 +00:00
pierre
6f7a39adab Fix compilation for arm-darwin using clang and forbid use of eabihf ABI for that target
git-svn-id: trunk@43205 -
2019-10-15 22:17:52 +00:00
florian
29bdbdba95 * reduce amount of software floating point exception checking, VSTR, VMOV, VLDR do not raise those
git-svn-id: trunk@43162 -
2019-10-10 20:31:30 +00:00
florian
245b58c249 + support for arm attributes
* abi notes fixed

git-svn-id: trunk@43157 -
2019-10-09 17:45:40 +00:00
florian
8ecdb2e9ca + dwarf support for tls threadvars
git-svn-id: trunk@43134 -
2019-10-05 20:48:31 +00:00
florian
a2d3522812 * general-dynamic -> global-dynamic
git-svn-id: trunk@43132 -
2019-10-05 20:48:29 +00:00
florian
16163b74ec + support for the gnu2 general-dynamic tls model on arm, use it instead of the gnu one as the gnu2 one can be relaxed (access optimizations by the linker)
+ support pic relocations in the internal assembler writer

git-svn-id: trunk@43128 -
2019-10-05 20:48:26 +00:00
florian
abb9401011 + tls models tlsm_general_dynamic and tlsm_local_exec for arm
git-svn-id: trunk@43127 -
2019-10-05 20:48:24 +00:00
florian
03dfc615dc + new relocations for arm tls
git-svn-id: trunk@43123 -
2019-10-05 20:48:21 +00:00
florian
03f7ef4c63 * renamed tls model switches and symbols to match gcc
git-svn-id: trunk@43122 -
2019-10-05 20:48:20 +00:00
florian
69786ffe73 somehow committing went wrong, second part of last commit:
+ AArch64: support for vX.8b/vX.16b register names
+ support for more than 256 registers in the register dat files
- removed totherregisterset
+ AArch64: use vmov to load immediates if possible
+ AArch64: use eor to clear mm registers

git-svn-id: trunk@42917 -
2019-09-03 21:07:33 +00:00
pierre
0fa280f4c2 Fix code generated in tarmnotnode.second_boolean
git-svn-id: trunk@42860 -
2019-08-28 07:38:35 +00:00
florian
5d1d9858d1 + VMovVMov2VMov optimization
git-svn-id: trunk@42727 -
2019-08-18 12:09:03 +00:00
florian
3d5ab366e1 * fix RemoveSuperfluousVMov if the VMov destination reg is an integer register, resolved #35978
git-svn-id: trunk@42726 -
2019-08-18 11:28:39 +00:00
florian
45847da693 * fix building for targets with no vfp support
git-svn-id: trunk@42693 -
2019-08-15 09:37:50 +00:00
florian
3a1ecd4f16 * fix tarminlinenode.first_sqrt_real
git-svn-id: trunk@42685 -
2019-08-13 22:12:53 +00:00
florian
0a0397c9f5 * forgotten part of previous commit: fix BccB2Cond optimization on arm
git-svn-id: trunk@42684 -
2019-08-13 22:12:52 +00:00
florian
ba0768b6a6 * building with -Cfvfpv2 hopefully fixed
git-svn-id: trunk@42683 -
2019-08-13 22:12:52 +00:00
florian
867df5362c + basic Neon support in the assembler writer
+ make use of VEOR if possible to clear VFP registers

git-svn-id: trunk@42682 -
2019-08-13 22:12:51 +00:00
florian
c418d63c16 + create defines with FPU capabilites
+ make use of FPU capability defines in the rtl

git-svn-id: trunk@42681 -
2019-08-13 22:12:49 +00:00
florian
85edf1c1eb * reworked arm vfp capability handling to use fpu_capabilites
git-svn-id: trunk@42679 -
2019-08-13 18:41:15 +00:00
florian
fd70fcace6 * fix BccB2Cond optimization on arm
git-svn-id: trunk@42676 -
2019-08-13 10:07:30 +00:00
florian
f23f3a4c5e * enable TCpuAsmOptimizer.RemoveSuperfluousVMov for VLDR
* fixed TCpuAsmOptimizer.RemoveSuperfluousVMov to be actually applied

git-svn-id: trunk@42668 -
2019-08-12 21:25:30 +00:00
florian
58bbbadc16 * fix return registers for hfa's containing singles
git-svn-id: trunk@42666 -
2019-08-12 20:30:18 +00:00
florian
5a379cc256 * fix detection of floating point constants for arm
git-svn-id: trunk@42665 -
2019-08-12 20:29:03 +00:00
Jonas Maebe
ce598c15ec * factored out the conditions under which add nodes need to perform
overflow checks
   o in particular ensure that cpu-specific overrides don't perform overflow
     checks when nf_internal is set

git-svn-id: trunk@42573 -
2019-08-03 12:19:50 +00:00
florian
99f92ce5dd * insert FPC_THROWFPUEXCEPTION call into the correct assembler list
git-svn-id: trunk@42540 -
2019-07-30 21:04:32 +00:00
florian
46bac33a2d + fpu_capabilities for arm
* some code converted to use fpu_capabilities

git-svn-id: trunk@42536 -
2019-07-30 21:04:28 +00:00
florian
b3ed34592f + software handling of exceptions on arm
* reworked software handling of exceptions so they can be check lazily

git-svn-id: trunk@42525 -
2019-07-28 21:06:36 +00:00
Jonas Maebe
3fee990218 * on Mach-O, PECOFF and ELF platforms, write local symbols as hidden/
private_extern (or plain global in case of PECOFF, as the effect is
    the same there): visible across object files, but they become local
    when linked into a binary/library. This enables cross-unit inlining
    of functions accessig implementation-only symbols.

git-svn-id: trunk@42340 -
2019-07-07 21:33:43 +00:00
pierre
828a248287 Systematically include fpcdefs.inc at sart of all units used by compiler
git-svn-id: trunk@42322 -
2019-07-03 13:35:05 +00:00
Jonas Maebe
faf75095cd * synchronised with trunk till r42189
git-svn-id: branches/debug_eh@42190 -
2019-06-07 18:24:38 +00:00
Jeppe Johansen
750567f8e3 Added T2 form of LDR/STR for SP relative forms.
git-svn-id: trunk@42169 -
2019-06-03 22:10:49 +00:00
Jeppe Johansen
cba4aeaca5 Fix division of constants on ARM thumb without long multiplication.
git-svn-id: trunk@42158 -
2019-06-01 20:30:09 +00:00
Jonas Maebe
a0e35fd1bc * synchronised with trunk till r42118
git-svn-id: branches/debug_eh@42119 -
2019-05-25 13:19:06 +00:00
Jonas Maebe
77658b925b * disable regular array -> dynamic array type coversion support unless
{$modeswitch arraytodynarray} is active (mantis #35576)
   o changed compiler to compile without this modeswitch
   o added the modeswitch to a test that depends on it

git-svn-id: trunk@42118 -
2019-05-25 12:31:32 +00:00
Jonas Maebe
9e9a982bfe * synchronised with trunk till r42095
git-svn-id: branches/debug_eh@42096 -
2019-05-18 18:43:51 +00:00
pierre
2ff391c25c Fix arm-aros rtl compilation
git-svn-id: trunk@42090 -
2019-05-17 06:39:57 +00:00
Jonas Maebe
1b6425176b * synchronised with trunk till r42049
git-svn-id: branches/debug_eh@42050 -
2019-05-12 18:44:05 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
Jonas Maebe
a0f850d57f * synchronised with trunk till r41885
git-svn-id: branches/debug_eh@41886 -
2019-04-16 16:20:44 +00:00
Jeppe Johansen
44beea91b5 - Fix UTX* optimizations that didn't consider the optional ROR parameter.
git-svn-id: trunk@41880 -
2019-04-15 21:52:55 +00:00
Jonas Maebe
50c82b6468 * synchronised with trunk till r41537
git-svn-id: branches/debug_eh@41538 -
2019-03-01 16:20:22 +00:00
yury
a277a5f8db * Removed unused local vars.
git-svn-id: trunk@41457 -
2019-02-25 11:22:49 +00:00
Jonas Maebe
a079e5fa80 * synchronised with trunk till r41449
git-svn-id: branches/debug_eh@41450 -
2019-02-24 20:01:53 +00:00
Jonas Maebe
7c4e7d6bd3 * support OS_32/OS_64 in cgsize2subreg for ARM MM registers to handle
records passed in MM registers

git-svn-id: trunk@41449 -
2019-02-24 19:59:03 +00:00
Jonas Maebe
bead1f8180 * properly set 8 byte parameter alignment for first parameter on ARM if
applicable

git-svn-id: trunk@41447 -
2019-02-24 19:58:57 +00:00
Jonas Maebe
07bd4ba517 * let all the case code generation work with tconstexprint instead of aint,
so it also works for 32 bit targets and a high level code generator
    (where aint is still 32 bit, but 64 bit operations are not decomposed)

git-svn-id: trunk@41441 -
2019-02-24 19:58:37 +00:00
Jonas Maebe
ac883969a9 * synchronised with trunk till r41423
git-svn-id: branches/debug_eh@41424 -
2019-02-23 17:08:03 +00:00
Jonas Maebe
4e5f48a25e * add support for HFA parameter passing for ARM hardfloat
(fixes test/cg/tcalext6)

git-svn-id: trunk@41421 -
2019-02-23 15:42:48 +00:00
Jonas Maebe
8b9e90dc7a * keep track of whether a routine has a C-style variadic parameter in the
procoptions even when it's through an array-of-const parameter
  * always call create_varargs_paraloc_info() instead of create_paraloc_info()
    in the former case, even when no varargs parameters are specified (because
    on some platforms even some non-variadic parameters need to be passed
    differently, such as on ARM with gnueabihf)

git-svn-id: trunk@41420 -
2019-02-23 15:42:45 +00:00
Jonas Maebe
1a559f5c60 * move the homogenous float aggregate determination function to a common
unit for ARM and AArch64

git-svn-id: trunk@41419 -
2019-02-23 15:42:39 +00:00
yury
3a43ffd57b * arm: Include pi_needs_got to current_procinfo.flags when the GOT register is accessed. It forces proper initialization of the GOT register at the beginning of a procedure. This fixes storing of a double constant to a field in a packed record and other rare copy operations when PIC is enabled.
git-svn-id: trunk@41405 -
2019-02-20 20:06:32 +00:00
yury
3e8c7f66b7 * arm: Fixed crash while loading double constants with PIC enabled. This is the regression after r41129. The crash has occurred due to usage of a rare code path. It will be fixed in the next commit.
git-svn-id: trunk@41404 -
2019-02-20 20:00:06 +00:00
Jonas Maebe
d99d1f1f30 * let the ARM code generator use the generic tcg.a_load_ref_cgpara() instead
of its own buggy version
   o added support to the generic version to override part of the functionality
     needed to implement an ARM quirk

git-svn-id: trunk@41335 -
2019-02-16 10:45:46 +00:00
Jonas Maebe
9d07e4948f * fix compilation of ARM compiler for LLVM
git-svn-id: branches/debug_eh@41210 -
2019-02-03 21:09:54 +00:00
Jonas Maebe
d93c05a90c * synchronised with trunk till r41207
git-svn-id: branches/debug_eh@41208 -
2019-02-03 21:05:37 +00:00
Jonas Maebe
353be907c7 * update the stack alignment field of parameters when doing so for paralocs
git-svn-id: trunk@41204 -
2019-02-03 21:00:57 +00:00
Jonas Maebe
7a65e1f393 * fixed ARM paraloc defs (for LLVM)
git-svn-id: trunk@41203 -
2019-02-03 21:00:51 +00:00
Jonas Maebe
da0deae9ae * removed unnecessary replacements of the paraloc def with arraydefs on ARM
git-svn-id: trunk@41202 -
2019-02-03 21:00:46 +00:00
Jonas Maebe
8c362eac67 * always emit UAL when using LLVM (clang does not and will not support
pre-UAL)

git-svn-id: trunk@41201 -
2019-02-03 21:00:41 +00:00
Jonas Maebe
a0d796e98d * synchronised with trunk till r41159
git-svn-id: branches/debug_eh@41160 -
2019-02-01 17:01:54 +00:00
florian
2b6076a719 * compilation fixed
git-svn-id: trunk@41139 -
2019-01-29 22:06:32 +00:00
Jonas Maebe
2d01fe76f6 * initialse the cgpara for the C-style varargs on ARM (needed for LLVM)
git-svn-id: trunk@41137 -
2019-01-29 21:39:23 +00:00
florian
2f40f81890 + sanity check
git-svn-id: trunk@41131 -
2019-01-29 20:40:41 +00:00
florian
afd4599d26 * correctly handle LDRD in TAoptBaseCpu.RegModifiedByInstruction
git-svn-id: trunk@41130 -
2019-01-29 20:40:40 +00:00
florian
acbf7d15c4 * do not load always the references into a register in g_concatcopy
git-svn-id: trunk@41129 -
2019-01-29 20:40:39 +00:00
florian
4db5478acc + support msr regf,reg32 on arm in the internal assembler
git-svn-id: trunk@41128 -
2019-01-29 20:38:51 +00:00
florian
a186f48442 * cosmetics
git-svn-id: trunk@41127 -
2019-01-29 20:17:47 +00:00
Jonas Maebe
b3a8543a56 * synchronised with trunk till r40942
git-svn-id: branches/debug_eh@40943 -
2019-01-20 17:37:07 +00:00
florian
94d7a02fae * modified patch by Gareth Moreton to pool TmpUsedRegs in the assembler optimizers, resolves #34679
git-svn-id: trunk@40938 -
2019-01-20 14:16:38 +00:00
florian
6c82b2d1da * -tls-dialect is not a as option, removed it, resolves #34901
git-svn-id: trunk@40920 -
2019-01-19 19:37:48 +00:00
Jonas Maebe
11511e13d5 * synchronised with trunk till r40723
git-svn-id: branches/debug_eh@40724 -
2019-01-01 13:22:17 +00:00
florian
9c03c29856 * not all targets support the tls-model switch, use it only if section thread vars are used
git-svn-id: trunk@40680 -
2018-12-27 23:14:38 +00:00
florian
a7c347fe56 * pass used tls model to the assembler
git-svn-id: trunk@40677 -
2018-12-27 20:54:14 +00:00
Jonas Maebe
882d676bc9 * synchronised with trunk till r40635
git-svn-id: branches/debug_eh@40636 -
2018-12-24 22:12:19 +00:00
Jonas Maebe
acf02ab64b * when creating wrappers, add a prefix to parameter names to prevent them
hiding the method name of the wrapped routine
   o also add a few more '&' prefixes to the generated wrapper code to
     prevent issues when keywords are used as identifiers

git-svn-id: trunk@40634 -
2018-12-24 22:10:06 +00:00
Jonas Maebe
31c047adf8 * synchronised with trunk till r40605
git-svn-id: branches/debug_eh@40606 -
2018-12-21 20:58:16 +00:00
yury
92e579a294 * Improved the comment.
git-svn-id: trunk@40586 -
2018-12-18 13:23:52 +00:00
yury
fdcb12d9f6 * ARM: Remove preindexing and postindexing for LDR in some cases when removing superfluous MOVs. It fixes crash when calling Format() if rtl is compiled with -O3.
git-svn-id: trunk@40585 -
2018-12-18 13:20:40 +00:00
Jonas Maebe
9630eb7ce9 * synchronised with trunk till r40466
git-svn-id: branches/debug_eh@40467 -
2018-12-04 19:54:31 +00:00
Jonas Maebe
122d0d36d6 + volatile() expression that marks an expression as volatile
* disable matching volatile references in the assembler optimisers, so they
    can't be removed (more conservative than needed, but better than removing
    too many)
   o the CSE optimiser will ignore them by default, because they're an unknown
     inline node for it
  * also removed no longer used fpc_in_move_x and fpc_in_fillchar_x inline node
    identifiers from rtl/inc/innr.inc, and placed fpc_in_unaligned_x at the
    right place

git-svn-id: trunk@40465 -
2018-12-04 19:53:20 +00:00
Jonas Maebe
4cd6f59bc3 * changed create_hlcodegen into a procvar, so that we don't have to insert
hlcgllvm in the uses clause of every unit that calls create_hlcodegen
   o prevents dependency cycles that can cause llvm codegen units to init
     before the cpu variants, which is bad since the llvm versions have to
     override the cpu variants in their init code (+ added checks in the
     init code that they are in fact initialised later)

git-svn-id: branches/debug_eh@40410 -
2018-11-29 21:31:15 +00:00
Jonas Maebe
bfc7c58a69 * synchronised with trunk till r40348
git-svn-id: branches/debug_eh@40349 -
2018-11-18 12:01:50 +00:00
pierre
aebc8527ef Also disable range checking in arm/aoptcpu unit
git-svn-id: trunk@40322 -
2018-11-15 22:01:25 +00:00
florian
095bd6da7d * do not re-used gottpoff symbols as they are PC-relative
git-svn-id: trunk@40321 -
2018-11-15 20:07:56 +00:00
pierre
4657f45e74 * Change first parameter type of function is_continuous_maks to aword type.
Add typecasts where needed to allow for successful compilation of arm-linux target
    with -CriotR options when building the compiler.

git-svn-id: trunk@40314 -
2018-11-14 13:13:19 +00:00
florian
9f16c34329 + initial work for tls-based threadvar support on arm-linux
git-svn-id: trunk@40267 -
2018-11-07 22:02:58 +00:00
florian
9b0ff05ee8 - get rid of MaxOps, it is redundant with max_operands
* MatchOpType with three operands is only available of max_operands>2

git-svn-id: trunk@40190 -
2018-11-02 21:32:29 +00:00
pierre
fbffd2a38f Fix typecast in FindRegDeAlloc call
git-svn-id: trunk@40122 -
2018-10-31 23:18:09 +00:00
pierre
e42ccccecf Disable range check completely in arm/cgcpu unit
git-svn-id: trunk@40112 -
2018-10-31 15:48:32 +00:00
Jonas Maebe
8555ec1438 + fpc_eh_return_data_regno() intrinsic to get the return register numbers
for the Dwarf EH exception handler result

git-svn-id: branches/debug_eh@40070 -
2018-10-28 18:16:38 +00:00
florian
2cbb9895be * pass float abi always to the arm assembler
git-svn-id: trunk@39996 -
2018-10-20 16:48:31 +00:00
pierre
92acd38f40 Fix for bug report #34380
git-svn-id: trunk@39986 -
2018-10-18 20:21:54 +00:00
Jonas Maebe
0b246f3dbd * converted Boolean8 to an internal type, and mapped Boolean to the
new internal pasbool1(type) (part of mantis #34411)
   o apply the _Bool x86-64 parameter passing rules only to pasbool1

git-svn-id: trunk@39949 -
2018-10-16 21:14:18 +00:00
Jeppe Johansen
4b227de02e Add ORN instruction for Thumb2.
git-svn-id: trunk@39714 -
2018-09-08 12:10:51 +00:00
florian
4aa0ad6735 * use vmov.xx to load float constants if possible
git-svn-id: trunk@39298 -
2018-06-24 12:40:00 +00:00
florian
4f5f3c4a09 + support for vmov.xx vreg,#imm on arm
git-svn-id: trunk@39297 -
2018-06-24 12:39:59 +00:00
Jonas Maebe
d69ad8fa41 * removed temppos field again from parameter locations: they're not allocated
by the temp manager of the current procedure

git-svn-id: trunk@38858 -
2018-04-27 19:18:55 +00:00
Jonas Maebe
4686f61002 * keep track of the temp position separately from the offset in references,
so that they can still be freed after the reference has been changed
    (e.g. in case of array indexing or record field accesses) (mantis #33628)

git-svn-id: trunk@38814 -
2018-04-22 17:03:16 +00:00
nickysn
518cdf9674 * replaced the saved_XXX_registers arrays with virtual methods inside
tcpuparamanager, very similar to the existing get_volatile_registers_XXX. The
  new methods are called get_saved_registers_XXX, where XXX is the register
  type ("int", "address", "fpu" or "mm")

git-svn-id: trunk@38794 -
2018-04-19 21:22:16 +00:00
florian
71e71ad267 * fix currency division on non x86 32 bit targets
* disable fix for #33439 during bootstrapping with 3.0.x, as 3.0.x cannot compile the currency division without the fix above

git-svn-id: trunk@38558 -
2018-03-17 22:44:44 +00:00
florian
208c2cce52 * fix case table detection for thumb
git-svn-id: trunk@38418 -
2018-03-05 21:44:19 +00:00
Károly Balogh
dbb91b5ef0 arm-netbsd: added platform define and dummy rtl files so the build passes for this platform. port not functional yet
git-svn-id: trunk@38412 -
2018-03-05 15:38:46 +00:00
florian
c3a0a4e252 + support fmrrd/fmdrr, resolves #32398
git-svn-id: trunk@38270 -
2018-02-17 16:32:11 +00:00
florian
cd41312a8f * fixes not(<qwordbool>) on arm
* fixes not(<(q/l)wordbool>) on avr

git-svn-id: trunk@38263 -
2018-02-16 22:38:35 +00:00
Jonas Maebe
1b66995754 * factored out check to determine whether a variable can be subscripted in
inline assembly, and fixed check after r35959 (mantis #32318)
   o can also subscript parameters passed by value on the stack
   o can also subscript local variables, the parameters passed by reference
     that are subsequently copied into a local

git-svn-id: trunk@37886 -
2018-01-01 14:29:21 +00:00
florian
4cf2a2672a changes to fix #32043
* changed most of the variables in the assembler readers used to store constants from aint to tcgint 
  as aint has only the size of the accumular while some CPUs (AVR) allow larger constants in instructions
+ allow access to absolute symbols with address type in inline assembler
* allow absolute addresses in avr inline assembler
+ tests

git-svn-id: trunk@37411 -
2017-10-06 21:07:19 +00:00
florian
5b755661d8 + patch by Simon Ameis: adds all the STM32F091* microcontroller units to the list of supported ARM MCUs, resolves issue #32484
git-svn-id: trunk@37378 -
2017-10-01 18:59:01 +00:00
Jeppe Johansen
09a8cafcd7 Restricted MlaCmp>Mlas optimization to only work in ARM mode.
git-svn-id: trunk@36602 -
2017-06-26 18:14:46 +00:00
Jeppe Johansen
f3889a191b Generate bx lr exit instruction in Thumb-2 instead of mov pc,lr as bx lr will trigger an exception return but mov doesn't.
git-svn-id: trunk@36597 -
2017-06-26 08:05:31 +00:00
Jonas Maebe
61af0fb72d * only take into account the location of the parameter at the callee side to
determine whether it's in a register if it's a pure assembler routine
  * you can't "index" implicit pointers either using their fields

git-svn-id: trunk@36287 -
2017-05-21 20:17:11 +00:00
nickysn
efc5e339d0 * use an enum instead of integer constants to represent inline numbers
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
  their enum name, instead of number

git-svn-id: trunk@36174 -
2017-05-10 14:41:43 +00:00
yury
2ae3ce79bb * ARM: Never use the "BLX label" instruction. Use "BL label" instead.
The linker will always change BL to BLX if necessary, but not vice versa (linker version dependent).
  "BLX label" ALWAYS changes the instruction set. It changes a processor in ARM state to Thumb state,
  or a processor in Thumb state to ARM state.

git-svn-id: trunk@36086 -
2017-05-04 15:55:55 +00:00
yury
95094e9a8f * Removed unused vars.
git-svn-id: trunk@36073 -
2017-05-04 10:38:49 +00:00
Jonas Maebe
aa82e00615 * fixed check to determine whether a record parameter can be subscripted
directly in inline assembly: that's only possible if it's a register
    parameter where the address of the record was passed (rather than the
    record itself), or if a parameter has been explicitly typecasted in
    Intel-style assembly using ".size"

git-svn-id: trunk@35959 -
2017-04-26 19:43:35 +00:00
florian
4868b83157 * do not generate always debug messages in the arm assembler optimizer
git-svn-id: trunk@35891 -
2017-04-22 09:37:18 +00:00
florian
50dba9ad66 * if both labels of a case label are equal, we still cannot skip the comparison in a jump tree, resolves #31589
git-svn-id: trunk@35880 -
2017-04-21 19:32:27 +00:00
florian
73c46a5988 - removed unused constants
git-svn-id: trunk@35664 -
2017-03-26 13:06:34 +00:00
florian
971280f082 + tarmcasenode.genjmptreeentry
git-svn-id: trunk@35649 -
2017-03-23 21:37:12 +00:00
yury
3bedccf946 * ARM scheduler need to move register de-allocs located before the instruction. Also preserve order of allocs and de-allocs.
git-svn-id: trunk@35552 -
2017-03-09 19:05:15 +00:00
yury
fe0e30030f * In ARM scheduler move all needed additional items with an instruction:
- all reg allocs and PIC labeels before the instruction;
  - all reg deallocs and reg syncs after the instruction.

  It fixes bug #31135.

git-svn-id: trunk@35545 -
2017-03-09 12:26:02 +00:00
Jonas Maebe
4c68ea1000 * use pocalls_cdecl and cstylearrayofconst more consistently instead of
ad hoc set constants containing varying number cdecl-like calling
    conventions
   o added pocall_sysv_abi_cdecl and pocall_ms_abi_cdecl to cstylearrayofconst
   o also allow C-style blocks with mwpascal instead of cdecl (mwpascal = cdecl
     with "const" = "constref" for record parameters)
   o did not touch cases related to name mangling and import/export names,
     because those are a real mess and easily break things left and right :/

git-svn-id: trunk@35479 -
2017-02-25 11:46:35 +00:00
florian
c961c72c30 * tarmtypeconvnode.first_int_to_real should call the generic method in the parent class, if soft fpu code is generated, resolves #31350
git-svn-id: trunk@35430 -
2017-02-12 16:05:13 +00:00
Jonas Maebe
015f034904 * reverted r35424, wasn't ready for commit yet
git-svn-id: trunk@35426 -
2017-02-11 21:21:44 +00:00
Jonas Maebe
4d9617da97 * fixed check to determine whether a record parameter can be subscripted
directly in inline assembly: that's only possible if it's a register
    parameter where the address of the record was passed (rather than the
    record itself)

git-svn-id: trunk@35424 -
2017-02-11 19:57:08 +00:00
florian
b41989adfa * offset of vstr/vld is limited to +/- 1020, take care of this during spilling
git-svn-id: trunk@35396 -
2017-02-04 18:42:02 +00:00
Jeppe Johansen
7e75457a3e Added more Nordic Semi controllers. Created a new unit for NRF52x controllers with a more precise register naming following Nordic SDK conventions.
Patch from Paul Mitchell.

git-svn-id: trunk@35274 -
2017-01-10 20:30:20 +00:00
Jonas Maebe
880d438704 * renamed t<cpuname>procinfo to tcpuprocinfo for all targets, so we can
inherit from it for LLVM without a thousand ifdefs

git-svn-id: trunk@35141 -
2016-12-16 22:41:21 +00:00
Károly Balogh
f5f895e2a3 syscalls: unify call reference creation across 4 different CPU archs. less copypasted code, brings x86_64 AROS support up to speed
git-svn-id: trunk@35034 -
2016-12-02 09:29:09 +00:00
Jonas Maebe
a25ebbba3e + added volatility information to all memory references
o separate information for reading and writing, because e.g. in a
     try-block, only the writes to local variables and parameters are
     volatile (they have to be committed immediately in case the next
     instruction causes an exception)
   o for now, only references to absolute memory addresses are marked
     as volatile
   o the volatily information is (should be) properly maintained throughout
     all code generators for all archictures with this patch
   o no optimizers or other compiler infrastructure uses the volatility
     information yet
   o this functionality is not (yet) exposed at the language level, it
     is only for internal code generator use right now

git-svn-id: trunk@34996 -
2016-11-27 18:17:37 +00:00
Jonas Maebe
b28221349e - removed aoptcs unit and (dummy) units that used it
o remenants of a long abandoned attempt at adding a generic
     assembler CSE optimiser

git-svn-id: trunk@34886 -
2016-11-13 16:06:14 +00:00
Jonas Maebe
86876ed114 * MaybeRecordOffset: initialise "mangledname" variable
git-svn-id: trunk@34857 -
2016-11-09 19:51:36 +00:00
Jonas Maebe
74a49b5f91 * restructured the the TExternalAssembler constructors so that the
hack for the Jasmin descendent is no longer needed

git-svn-id: trunk@34852 -
2016-11-09 19:51:20 +00:00
Károly Balogh
657aa06360 arm: arm-aros syscall support
git-svn-id: trunk@34809 -
2016-11-06 14:31:42 +00:00
marcus
86940dfb32 AROS: added arm-aros target to compiler and fpcmake
git-svn-id: trunk@34805 -
2016-11-06 10:51:45 +00:00
pierre
1e9491550d nutils.pas: Add new procedure:
procedure node_change_local_switch(p : tnode;cs : tlocalswitch;enable : boolean);
    to add/remove cs local switch from all p tnode tree localsettings.

    modify second_prefetch implementation in arm, ppcgen and x86 subdirectories
    to use node_change_local_settings to temporarily disabled
    checkpointer local switch, as prefetch is allowed even on unaccessible addresses.
    (previous code was buggy because I frogot that each node has it own localswitches).

git-svn-id: trunk@34576 -
2016-09-29 21:34:34 +00:00
pierre
fe4e2956c6 Disable checkpointer call when handling left of prefetch node
git-svn-id: trunk@34559 -
2016-09-24 07:34:10 +00:00
Jonas Maebe
aa1be3276f - removed default value of _typ parameter of TAsmData.(Weak)RefAsmSymbol():
it was AT_NONE, which is invalid and should never be used
  * explicitly pass the correct value for all calls to those methods elsewhere
    in the compiler

git-svn-id: trunk@34250 -
2016-08-05 07:09:16 +00:00
Jeppe Johansen
6a1c1e4f29 Added support for NRF52832 controllers.
git-svn-id: trunk@34170 -
2016-07-22 10:01:10 +00:00