Commit Graph

411 Commits

Author SHA1 Message Date
florian
d9d231c875 * AAarch64: handle initializations of vector registers with zero properly
git-svn-id: trunk@45740 -
2020-07-07 20:56:19 +00:00
florian
80111a0a60 * make local variables in assembler blocks working again after r44933
* test for #37218

git-svn-id: trunk@45667 -
2020-06-20 20:17:53 +00:00
florian
42e4d66c5e * AArch64: enable TARMAsmOptimizer.OptPass1And
git-svn-id: trunk@45544 -
2020-05-31 21:40:59 +00:00
florian
84a1f614d9 * fix several double ;
git-svn-id: trunk@45488 -
2020-05-24 17:52:09 +00:00
florian
8d1660893b * compilation with -Oodfa fixed
git-svn-id: trunk@45234 -
2020-05-03 15:18:08 +00:00
nickysn
a8fe46c0f5 + introduced labelmaxlen in tasminfo and added code in ReplaceForbiddenAsmSymbolChars that limits the
output label to that length

git-svn-id: branches/z80@45066 -
2020-04-25 12:59:25 +00:00
svenbarth
5ef9a78f5f * fix for Mantis #36951: B and BL can take immediate literals as well
+ added test

git-svn-id: trunk@44999 -
2020-04-22 20:19:14 +00:00
svenbarth
03eb114e97 * fix for Mantis #36951: if the instruction only has one operand and it's a reference then don't internal error, but instead return OS_NO
git-svn-id: trunk@44998 -
2020-04-22 20:19:09 +00:00
svenbarth
2aa0e50873 * implement dogetcopy for the Aarch64 variant of the tryfinally node
git-svn-id: trunk@44957 -
2020-04-21 06:07:06 +00:00
svenbarth
7f4b94e408 * generate jump tables into the same section as the code as otherwise we'll get bogus relocations (in case of clang.exe) or a future support for armasm64.exe will reject the relative symbols outright
git-svn-id: trunk@44949 -
2020-04-21 06:06:36 +00:00
svenbarth
042aae2455 * the clang assembler does not provide support for the SEH directives we need (only the LLVM backend would be able to use them), thus we need to manually convert them to data sections
git-svn-id: trunk@44947 -
2020-04-21 06:06:28 +00:00
svenbarth
2b59000d56 + implement compiler support for SEH on Win64
Note: due to the way we access variables in a nested function (which in this case includes exception filters) we can not extract the finally handlers and call them (like we do on i386 and x86_64, but instead we duplicate the finally code)

git-svn-id: trunk@44941 -
2020-04-21 06:06:05 +00:00
svenbarth
26c45f550a * when building a reference with an identifier, initialize the operand so that page offsets of functions are handled correctly
git-svn-id: trunk@44933 -
2020-04-21 06:05:32 +00:00
svenbarth
1fb2d9540c * allow ADD instructions with a page offset load with either a symbol or a base register
git-svn-id: trunk@44932 -
2020-04-21 06:05:28 +00:00
svenbarth
3f40e00392 * the clang assembler for COFF requires at least an "r" to generate a readonly section
git-svn-id: trunk@44929 -
2020-04-21 06:05:18 +00:00
svenbarth
a6f1c04f22 * Windows does not support a GOT, so rely on page relative addressing
git-svn-id: trunk@44916 -
2020-04-21 06:04:31 +00:00
svenbarth
dfde4def62 + add a GAS compatible variant of the Clang assembler (currently used for Aarch64-Win64 as no GNU AS exists for that target, yet)
git-svn-id: trunk@44915 -
2020-04-21 06:04:27 +00:00
svenbarth
3af74d2fd2 + implement initial compiler support for Win64 on Aarch64
git-svn-id: trunk@44914 -
2020-04-21 06:04:22 +00:00
florian
099faf2d2b * factored out and improved TARMAsmOptimizer.RedundantMovProcess
+ AArch64: use TARMAsmOptimizer.RedundantMovProcess

git-svn-id: trunk@44799 -
2020-04-18 21:48:25 +00:00
florian
6ccb8b83da + AArch64: TCpuAsmOptimizer.OptPass1Mov
git-svn-id: trunk@44795 -
2020-04-18 17:58:45 +00:00
florian
2b3d7dd42c * bail out early if possible
git-svn-id: trunk@44794 -
2020-04-18 17:58:44 +00:00
florian
7125cb505c + AAarch64: assembler optimization Bl2B
git-svn-id: trunk@44785 -
2020-04-18 15:17:29 +00:00
florian
5a07298ea5 + AAarch64: FOpFMov2FOp assembler optimization
git-svn-id: trunk@44773 -
2020-04-18 09:38:10 +00:00
florian
001057b52e * re-added assembler optimization accidently removed in r44738 as noted by margers on the mailing list
git-svn-id: trunk@44751 -
2020-04-17 21:02:35 +00:00
florian
9176efbab4 * factored out TARMAsmOptimizer.OptPass1SXTH
* AArch64: use TARMAsmOptimizer.OptPass1SXTH

git-svn-id: trunk@44739 -
2020-04-16 21:19:14 +00:00
florian
19a9d4c4ac * factored out TARMAsmOptimizer.OptPass1SXTB
* AArch64: use TARMAsmOptimizer.OptPass1SXTB

git-svn-id: trunk@44738 -
2020-04-16 21:19:13 +00:00
florian
7172397077 * factored out TARMAsmOptimizer.OptPass1UXTH
* AArch64: use TARMAsmOptimizer.OptPass1UXTH

git-svn-id: trunk@44737 -
2020-04-16 21:19:12 +00:00
florian
9bcff94e9e * factored out TARMAsmOptimizer.OptPass1UXTB
* several other routines being very similar for ARM and AAarch64 moved to aoptarm

git-svn-id: trunk@44725 -
2020-04-15 20:21:29 +00:00
florian
c4b66c89f7 * check for stup instead of stp
git-svn-id: trunk@44722 -
2020-04-14 20:52:27 +00:00
florian
2276caae24 + common assembler optimizer base class for arm and aarch64
git-svn-id: trunk@44720 -
2020-04-13 21:01:01 +00:00
florian
3dff78621c * Aarch64: UTX/STX instructions include now the postfix, so it is the same as for ARM
git-svn-id: trunk@44718 -
2020-04-13 18:04:34 +00:00
florian
2bae2a451c * load 0 into unaligned memory in a simpler way
git-svn-id: trunk@44717 -
2020-04-13 17:29:09 +00:00
Jonas Maebe
10b15628ab * split i/t_darwin from i/t_bsd, as they don't have that much in common
any more

git-svn-id: trunk@44407 -
2020-03-29 18:27:27 +00:00
florian
95e8992e2f + AArch64: profiler support for aarch64-linux
git-svn-id: trunk@44216 -
2020-02-19 21:10:19 +00:00
florian
e50c4f6373 + AAarch64: optimize divisions by constant
git-svn-id: trunk@44204 -
2020-02-17 20:11:32 +00:00
florian
9989d408fd * AArch64 and i386: omit exit stackframe, same as r44191 for x86-64
git-svn-id: trunk@44196 -
2020-02-16 20:14:26 +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
Jonas Maebe
7a3a4244d1 * accept locals replaced by symbols in inline assembly by the LLVM code
generator in the AArch64 assembler writer

git-svn-id: trunk@43887 -
2020-01-07 20:22:23 +00:00
Jonas Maebe
3abdec9c95 * LLVM/AArch64: don't perform the parameter location extension workarounds
for LLVM, as that results in LLVM assuming exactly the opposite of
    what's intended (namely that the extended locations contain valid
    rather than invalid bits)

git-svn-id: trunk@43886 -
2020-01-07 20:22:20 +00:00
Jonas Maebe
a75247d9b0 * AArch64: fixed parameter defs for smallsets passed in registers whose size
is not a power of two

git-svn-id: trunk@43883 -
2020-01-07 20:22:10 +00:00
Jonas Maebe
9bd33f7a45 + support for LLVM metadata constant string parameters
o they are implemented as a new metadata register class, whereby the
     subregister indicates the metadata type (currently always a string)
     and the superregister is an index in the metadata array (which
     contains the strings). LLVM metadata can only be passed as parameters
     to intrinsics in bitcode, so moves of metadata into other registers
     triggers internal errors and when moving them into parameters, we
     replace the parameter's register with the metadata register (and look
     up the corresponding string when writing out the bitcode)

git-svn-id: trunk@43816 -
2019-12-30 15:04:57 +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
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
florian
688c7d439f o AArch64:
* properly initialize FPU
    * FMOV cannot throw an FPU exception

git-svn-id: trunk@43167 -
2019-10-11 21:55:48 +00:00
Jonas Maebe
4deb62ad87 * fix for "ldr label" support in AArch64 assembler reader (r42988)
git-svn-id: trunk@43016 -
2019-09-15 17:26:25 +00:00
svenbarth
61642ffaa4 * Aarch64 asm reader: explicitely set the refaddr for local labels
git-svn-id: trunk@42989 -
2019-09-13 20:38:25 +00:00
svenbarth
ef154fb454 * Aarch64 asm reader: LDR instruction allows labels as well
git-svn-id: trunk@42988 -
2019-09-13 20:38:22 +00:00
florian
fa2e751f9f + AArch64: implementation of taarch64casenode.genlinearlist
git-svn-id: trunk@42973 -
2019-09-10 18:46:56 +00:00
florian
58eef0a5aa + AAarch64: TCpuAsmOptimizer.OptPass1Shift makes use of RemoveSuperfluousMove
git-svn-id: trunk@42971 -
2019-09-09 20:59:55 +00:00
florian
ce9e1a3419 + AArch64: FoldShiftProcess fixed
git-svn-id: trunk@42963 -
2019-09-08 20:53:43 +00:00
florian
c3c3e99c64 + AArch64: implemented TCpuAsmOptimizer.OptPass1Data
git-svn-id: trunk@42962 -
2019-09-08 20:53:43 +00:00
florian
bc473508ff * AArch64: several issues with taicpu.spilling_get_operation_type fixed
git-svn-id: trunk@42961 -
2019-09-08 20:53:42 +00:00
florian
cc49d256ea + AArch64: CMPB.E/NE2CBNZ/CBZ optimization
git-svn-id: trunk@42960 -
2019-09-08 20:53:41 +00:00
florian
0c6f7321bf + AArch64: FoldShiftProcess optimization
git-svn-id: trunk@42924 -
2019-09-05 20:15:56 +00:00
florian
a019536cd5 * avoid that -0.0 is handled by the eor optimization
git-svn-id: trunk@42921 -
2019-09-04 20:45:24 +00:00
florian
8ffb72ddd0 * another missing part of r42916 ...
git-svn-id: trunk@42919 -
2019-09-04 16:36:54 +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
florian
078595be4c + support for software floating point exception handling on AArch64 (-CE)
git-svn-id: trunk@42891 -
2019-09-01 17:26:11 +00:00
florian
9c00a8b616 + FMA support for aaarch64
git-svn-id: trunk@42885 -
2019-08-31 19:37:17 +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
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
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
dc2cbf8018 * synchronised with trunk till r41725
git-svn-id: branches/debug_eh@41726 -
2019-03-17 15:25:31 +00:00
Jonas Maebe
d34e0b091b * fixed aarch64 shifterop parsing in inline assembly
git-svn-id: trunk@41650 -
2019-03-09 16:11:31 +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
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
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
382d5060a0 * aarch64: According to ARM64 ABI, function's arguments and the result are not required to be sign/zero extended to a full register size. Obey this rule for all targets except iOS where sign/zero extension is required.
git-svn-id: trunk@41412 -
2019-02-22 17:59:54 +00:00
Jonas Maebe
f26ac9026e * enable LLVM support Linux/AArch64
o also put the regular function result before the partfpstruct parameter

git-svn-id: branches/debug_eh@40577 -
2018-12-16 20:46:44 +00:00
Jonas Maebe
b41cd1eb6a * synchronised with trunk till r40575
git-svn-id: branches/debug_eh@40576 -
2018-12-16 20:45:55 +00:00
Jonas Maebe
ac8411f3cf * pass dynamic array parameters of cdecl routines by value on AArch64
(like on onther platforms)
   o it was passed by reference as a side effect of the fact arrays in C are
     pointers, but a dynamic array already is a pointer

git-svn-id: trunk@40573 -
2018-12-16 20:44:35 +00:00
Jonas Maebe
95171a1e22 * initialise cgpara with valid data for the C-style "array of const" para
(necessary for the LLVM backend)

git-svn-id: trunk@40571 -
2018-12-16 20:44:28 +00:00
Jonas Maebe
820d2f7135 * support OS_32/OS_64 in AArch64 cgsize2subreg() for MM registers (can happen
for records with floating point fields with the LLVM code generator)

git-svn-id: trunk@40570 -
2018-12-16 20:44:24 +00:00
Jonas Maebe
ff002e2664 * set paralocations correctly for LLVM/AArch (must be register-type instead
of parameter-type based)

git-svn-id: trunk@40568 -
2018-12-16 20:44:18 +00:00
Jonas Maebe
6b58185bda * fixed shifval for big endian (bits instead of bytes)
git-svn-id: trunk@40567 -
2018-12-16 20:44:15 +00:00
Jonas Maebe
6e453a1477 * fixed paraloc def when changing the size to OS_32
git-svn-id: trunk@40566 -
2018-12-16 20:44:12 +00:00
Jonas Maebe
52fec8a94a * when optimising subsetreg moves for aarch64, take into account the fact
that the subsetreg itself can be 32 or 64 bit (mantis #33607)

git-svn-id: trunk@40512 -
2018-12-09 14:46:52 +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
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
yury
4357caaad8 * Removed unused local vars.
git-svn-id: trunk@40183 -
2018-11-02 18:44:29 +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
112fb4613b * take care of the fact that x and w registers overlap when carrying out the Str/LdrAdd/Sub2Str/Ldr Postindex optimization
git-svn-id: trunk@40023 -
2018-10-24 17:38:51 +00:00
florian
0a5e6d29cb + implement assembler optimization Str/LdrAdd/Sub2Str/Ldr Postindex done
git-svn-id: trunk@40017 -
2018-10-23 20:41:27 +00:00
florian
379c2fe821 * cleanup debug code
git-svn-id: trunk@40016 -
2018-10-22 21:27:36 +00:00
florian
f27fee5566 + make use of the BFI instruction in tcgaarch64.a_load_ref_reg_unaligned
git-svn-id: trunk@40015 -
2018-10-22 21:23:48 +00:00
pierre
92acd38f40 Fix for bug report #34380
git-svn-id: trunk@39986 -
2018-10-18 20:21:54 +00:00
yury
4643a0b1ff * Register external gas assembler for aarch64-android and x86_64-android.
git-svn-id: trunk@39969 -
2018-10-18 11:48:27 +00:00
yury
93d672bf16 * aarch64: Fixed loading of a function result which is returned in 4 32-bit MM registers to 2 64-bit int registers. Bug #30329.
git-svn-id: trunk@39953 -
2018-10-17 11:41:34 +00:00
yury
671d31df1d + Added support for the aarch64-android target.
git-svn-id: trunk@39862 -
2018-10-06 09:33:09 +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
efef9125b5 * another compilation fix
git-svn-id: trunk@38211 -
2018-02-11 18:39:49 +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
a1a14eaaa8 * fix aarch64 building
git-svn-id: trunk@37025 -
2017-08-22 08:44:56 +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
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
nickysn
c8487c4150 + added individual bits of the x86 flags register as subregisters
git-svn-id: trunk@35955 -
2017-04-26 13:52:52 +00:00
florian
73c46a5988 - removed unused constants
git-svn-id: trunk@35664 -
2017-03-26 13:06:34 +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
pierre
1b1fe68f92 Fix aarch64 cycle after constant parser simplification change in rev 35229-35230
git-svn-id: trunk@35239 -
2017-01-05 13:41:44 +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
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
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
pierre
89c1b68b14 * Delete regvars unit.
This unit was empty unless OLDREGVARS macro was set,
    but this does not compile and no change has been made since 2011.

  * Remove regvars from all _USES clauses.

git-svn-id: trunk@34808 -
2016-11-06 14:01:39 +00:00
Jonas Maebe
f891788a86 * simplification of and fix for AArch64 cpupara.is_hfa_internal() (patch by
modulo7, mantis #30381)
   o check for array elements of size 0 does not make sense after we've
     established it's an array of floats
   o since the recursive call to is_hfa_internal() already checks for
     floats, we don't have to do it before calling it again for the
     elements of an array
   o set the result to "true" if the array is small enough to be a HFA

git-svn-id: trunk@34293 -
2016-08-12 16:53:02 +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
Jonas Maebe
a0efde8167 * automatically generate necessary indirect symbols when a new assembler
symbol is defined
   o removed all places where AB_INDIRECT symbols were explicitly generated
   o only generate AB_INDIRECT symbols for AT_DATA on systems_indirect_var_imports
   o for some symbols an indirect symbol is always required (because they are
     dereferenced by code in RTL units) -> use new AT_DATA_FORCEINDIRECT type

git-svn-id: trunk@34165 -
2016-07-20 20:53:03 +00:00
Jonas Maebe
1cb8c0d00c * specify the def of assembler level symbols defined via
tasmdata.DefineAsmSymbol() and all routines that call it
   o will be used to automatically generate AB_INDIRECT sybols when
     necessary

git-svn-id: trunk@34164 -
2016-07-20 20:52:59 +00:00
Jonas Maebe
8d77de6b22 - removed InsertPData leftover from ARM copy of this file
git-svn-id: trunk@34162 -
2016-07-20 20:52:53 +00:00
Jonas Maebe
0ed6c3d80e * also use the last floating point parameter register on AArch64 in case of
a HFA type (which in practice also applies to plain floating point types)
    (patch by Alfred, mantis #30207)

git-svn-id: trunk@33922 -
2016-06-05 20:18:24 +00:00
Jonas Maebe
1feb062f7d * similar change as in r33393 but now for a_load_reg_ref_unaligned(), although
it's unlikely it would ever cause a problem there

git-svn-id: trunk@33594 -
2016-05-01 12:35:06 +00:00
Jonas Maebe
2a1f2b9fd9 * fixed a_load_regconst_subsetreg_intern() when loading a 32 bit register
to a non-zero bit offset in a subsetreg (mantis #29933)

git-svn-id: trunk@33498 -
2016-04-13 17:09:31 +00:00
Jonas Maebe
8c0d9b581c * don't write the destination register in a_load_ref_reg_unaligned() before
the reference has been used for the last time, as the destination
    register could be the base or index register of the reference

git-svn-id: trunk@33393 -
2016-03-30 20:04:31 +00:00
Jonas Maebe
322493c195 * fixed overflow checking on AArch64 for signed multiplications with zero
(mantis #29912)

git-svn-id: trunk@33380 -
2016-03-29 09:50:42 +00:00
Jonas Maebe
73a303c899 * no need to call maybeadjustresult() after performing a 64 bit operation
git-svn-id: trunk@33379 -
2016-03-29 09:50:39 +00:00
Jonas Maebe
fa3b0ca312 * support marking defs created via the getreusable*() class methods as
"don't free even if not registered"; use for defs that may not be written
    to a ppu file, but that must nevertheless survive the compilation of the
    current module
  * mark all defs created for para locations as "don't free even if not
    registered", because we don't discard and recalculate all para locations
    after a module has been compiled (since that's not needed)
   o solves issues if the paralocations for a routine in the interface of
     unit A are calculated while the implementation of unit B gets
     compiled, and a new reusable type is allocated at that point which
     is not used anywhere else (after r32160)

git-svn-id: trunk@32235 -
2015-11-04 20:46:18 +00:00
Jonas Maebe
7c594b0288 + added support for using Clang as an assembler, and make it the default
for all non-ppc(32/64) Darwin platforms
   o pass the macosx-version-min/iphoneos-version-min to clang as an assembler,
     so that it properly sets this information starting with Xcode 7 (solves
     errors when targeting the iOS simulator, and warnings about object files
     being compiled for a different OS X version when targeting (Mac) OS X)
   o the old assembler is still selectable via -Aas-darwin (required with
     Xcode 3.1.x and older)
   o since the first Xcode version that shipped with Clang is Xcode 3.2, which
     is available for Mac OS X 10.6, most users should not encounter any issues
     with the new default (in fact, it fixes some tests for x86 because Clang
     supports some instructions that "as" doesn't). Clang does not support
     Stabs however, so -gs does require the use of -Aas-darwin

git-svn-id: trunk@31830 -
2015-09-25 18:31:54 +00:00
Jonas Maebe
1131b08d6d * changed idtext of as_darwin to AS-DARWIN, so it can be explicitly
selected via -Aas-darwin (since it compares uppercased strings)

git-svn-id: trunk@31808 -
2015-09-24 06:49:29 +00:00
Jonas Maebe
8155d759dc - reverted r31806, it breaks building on non-Darwin (mantis #28716)
git-svn-id: trunk@31807 -
2015-09-24 06:44:12 +00:00
Jonas Maebe
c0b451e788 - removed as_darwin, since there is no difference with as_gas (there is no
GNU as from binutils for Darwin, and Apple's "as" is based on an old
    version of GNU as)
   o this will not cause any backward compatibility problems, as the
     previous identifier for as_darwin was "AS-Darwin" and the compiler
     compared the uppercase value of the -A parameter to the identifier,
     so it was not explicitly selectable earlier. The new name is "AS",
     so it is explicitly selectable via -Aas like on other platforms.

git-svn-id: trunk@31806 -
2015-09-23 21:25:38 +00:00
Jonas Maebe
392af652df * let de syntax for got/page offsets depend on the target OS rather than
on the assembler

git-svn-id: trunk@31802 -
2015-09-23 20:38:08 +00:00
Jonas Maebe
991e1f49bd * store a pointer to the used tasminfo record in every assembler writer, so
that we can use assembler writers with different conventions from the
    currently set target_asm (e.g. an x86 assembler writer for inline assembly
    in LLVM IR)

git-svn-id: trunk@31628 -
2015-09-12 23:32:13 +00:00
Jonas Maebe
b3d0197f98 * factored out the output file handling (mostly writing data) from the
external assembler writer, so we can reuse the archtecture-specific
    writers to write inline assembly in LLVM IR files

git-svn-id: trunk@31625 -
2015-09-12 23:32:01 +00:00
Jeppe Johansen
3cb9be73bc Moved tcontrollerdatatype out into cpuinfo.
Added cputype and fputype info to tcontrollerdatatype arrays.

git-svn-id: trunk@31574 -
2015-09-07 20:36:54 +00:00
Jonas Maebe
0fc1fd6ac1 * replaced current_procinfo.currtrue/falselabel with storing the true/false
labels of LOC_JUMP in the node's location. This generates some extra jumps
    for short circuit boolean and/or-expressions if optimizations are off, but
    with optimisations enabled the generated code is the same (except for JVM
    because the jump threading optimisation isn't enabled there yet).

git-svn-id: trunk@31431 -
2015-08-27 18:28:57 +00:00
Jonas Maebe
f402b0d7df * changed getpointerdef() into a tpointerdef.getreusable() class method
o allows removing the ugly x86 hacks

git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
Jonas Maebe
e02e742997 * removed OS check when loading the address of a symbol on AArch64, it's
probably the same everywhere

git-svn-id: trunk@30900 -
2015-05-24 16:50:13 +00:00
Jonas Maebe
8628d50aba + Linux/AArch64 compiler support (patch by Edmund Grimley Evans)
git-svn-id: trunk@30893 -
2015-05-22 09:25:05 +00:00
Jonas Maebe
585e4a9a14 * corrected cosmetic ARM/AArch64 copy/paste leftovers (patch by
Edmund Grimley Evans)

git-svn-id: trunk@30847 -
2015-05-14 14:42:12 +00:00
Jonas Maebe
7395058cf3 * recognise tb(n)z as branch opcode (patch by Edmund Grimley Evans)
git-svn-id: trunk@30846 -
2015-05-14 14:42:03 +00:00
florian
b222d0b663 * correctly handle LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF in second_int_to_bool, resolves issue #28007
git-svn-id: trunk@30765 -
2015-05-02 13:52:50 +00:00
florian
7dd1d6aa77 o fixes handling of iso i/o parameters/program parameters:
* explicit reset is needed
  * variable must be declared again

git-svn-id: trunk@30757 -
2015-05-01 20:58:31 +00:00
Jonas Maebe
49aef02ef2 * fixed register size of uxtb in case of a 64 bit scan operation
(mantis #27954)

git-svn-id: trunk@30724 -
2015-04-25 16:36:45 +00:00
Jonas Maebe
61e4a1b811 + added tasmlist parameter to getintparaloc() (needed for llvm)
git-svn-id: trunk@30429 -
2015-04-04 14:29:16 +00:00
Jonas Maebe
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Jonas Maebe
8334597476 * a homogeneous float aggregate can maximally contain 4 elements
(mantis #27665)

git-svn-id: trunk@30229 -
2015-03-14 21:46:45 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Jonas Maebe
b821e31442 * force constants into a registers in the 32x32->64 optimized case
git-svn-id: trunk@30034 -
2015-02-28 22:31:03 +00:00
Jonas Maebe
ada5060a34 * set pi_do_call for AArch64 mod/div nodes, as they call FPC_DIVBYZERO
git-svn-id: trunk@30032 -
2015-02-28 22:30:57 +00:00
Jonas Maebe
879afbb7be * removed -Oodfa warnings
git-svn-id: trunk@29986 -
2015-02-23 22:57:24 +00:00
Jonas Maebe
c41759a026 - removed a lot of unused copied internal assembler code
git-svn-id: trunk@29985 -
2015-02-23 22:57:21 +00:00
Jonas Maebe
2ab7f5c35d * moved x86-specific requirements from the generic bsr/bsf code to the
x86 code generator (register size constraints)

git-svn-id: trunk@29984 -
2015-02-23 22:57:18 +00:00
Jonas Maebe
a8d05b66e2 + AArch64 internal bsf/bsr support
git-svn-id: trunk@29979 -
2015-02-23 22:57:02 +00:00
Jonas Maebe
b40a4d1b5a + support for "xor mmreg,mmreg" for initialising global floating point
regvars

git-svn-id: trunk@29978 -
2015-02-23 22:56:59 +00:00
Jonas Maebe
07f31d560c + also perform sign/zero-extensions of the index in vecn using extended
registers in references

git-svn-id: trunk@29968 -
2015-02-23 22:56:03 +00:00
Jonas Maebe
d6de2c03cb * generic part of r26050 from the hlcgllvm branch: made tcgvecnode hlcg-safe
o in particular, add tdef size information to the update_reference*()
     methods, and factored out offset adjustments into its own method
   o also make sure the passed size to update_reference*() corresponds to the
     actual size of the index, as it's no longer guaranteed to be ptruint
     since the previous commit

git-svn-id: trunk@29967 -
2015-02-23 22:56:00 +00:00
Jonas Maebe
97df25cc29 + use reference/add "extended register" scale modes for vecnodes
git-svn-id: trunk@29966 -
2015-02-23 22:55:57 +00:00
Jonas Maebe
b5b7e0f338 * ensure that 64->32 bit truncations cannot be optimized away by the
register allocator on AArch64 + test (did not get caught by existing
    tests)

git-svn-id: trunk@29965 -
2015-02-23 22:55:54 +00:00
Jonas Maebe
1de8e53edd + AArch64 jump table support
git-svn-id: trunk@29964 -
2015-02-23 22:55:42 +00:00
Jonas Maebe
d4d9e361fc + AArch64 optimized version of a_load_regconst_subsetreg_intern()
git-svn-id: trunk@29963 -
2015-02-23 22:55:39 +00:00
Jonas Maebe
555194a67b + AArch64 optimized version of a_load_subsetreg_subsetreg()
git-svn-id: trunk@29962 -
2015-02-23 22:55:36 +00:00
Jonas Maebe
602853d40b + AArch64 optimized version of a_load_subsetreg_reg()
git-svn-id: trunk@29961 -
2015-02-23 22:55:33 +00:00
Jonas Maebe
c9de3b2ecd * use the zero register for a_load_const_ref(0)
git-svn-id: trunk@29960 -
2015-02-23 22:55:29 +00:00
Jonas Maebe
07455fb889 + inlined versions of concatcopy
git-svn-id: trunk@29959 -
2015-02-23 22:55:26 +00:00
Jonas Maebe
e6ab39765d * add restrictions for loaded/stored registers in case of references
with write-back

git-svn-id: trunk@29958 -
2015-02-23 22:55:23 +00:00
Jonas Maebe
14bd77f11c * removed ARM copy/paste stuff
git-svn-id: trunk@29956 -
2015-02-23 22:55:17 +00:00
Jonas Maebe
ff73d97e7f * temporary workaround for writing INS/UMOV operands, as these require
vector subregisters that we cannot represent yet. We only have to
    load/store lower single/double precision contents via them though,
    so reuse SUBMMS/SUBMMD for now.

git-svn-id: trunk@29955 -
2015-02-23 22:55:14 +00:00
Jonas Maebe
bc5a33ffac * fixed flags_to_cond() and inverse_cond() for C_GE
git-svn-id: trunk@29954 -
2015-02-23 22:55:11 +00:00
Jonas Maebe
42aca4db46 * pass managed function result addresses as a hidden first parameter instead
of in X8, as the ABI allows this deviation (see added comments) and it's
    required for some internal RTL code to call interface methods via RTTI

git-svn-id: trunk@29953 -
2015-02-23 22:55:08 +00:00
Jonas Maebe
bb1274a8ee * make DoPipe() a method of TExternalAssembler and use it in
TAArch64AppleAssembler to determine whether we have to add extra
    parameters to support assembling via a pipe ("as" is a symlink to
    clang for Arch64 on OS X, and needs to be explicitly told its going to
    receive assembler code from standard input)

git-svn-id: trunk@29952 -
2015-02-23 22:55:05 +00:00
Jonas Maebe
f1fb880f18 * fixed debug register values for vector registers
git-svn-id: trunk@29942 -
2015-02-23 22:54:15 +00:00
Jonas Maebe
e2d21a5716 * reuse simple memory paralocs, since we always setup a stack frame and
we can address them via the frame pointer

git-svn-id: trunk@29941 -
2015-02-23 22:54:12 +00:00
Jonas Maebe
a81e81c775 + override second_int_to_bool(), because the generic version assumes that
OP_OR sets the flags

git-svn-id: trunk@29940 -
2015-02-23 22:54:09 +00:00
Jonas Maebe
966a851997 + a_loadmm_intreg_reg() and a_loadmm_reg_intreg() implementations
git-svn-id: trunk@29939 -
2015-02-23 22:54:06 +00:00
Jonas Maebe
41fba0c4f7 * switched to using the stack pointer as base register for the temp allocator
instead of the frame pointer register:
      1) we exactly know the offsets of the temps from the stack pointer
         after pass 1 (based on the require parameter stack size for called
         routines), while we don't know it for the frame pointer (it depends
         on the number of saved registers)
      2) temp offsets from the stack pointer are positive while those from
         the frame pointer are negative, and we can directly encode much
         bigger positive offsets in the instructions
   o move the stack pointer register to a virtual register in
     loadparentfpn, because many instructions cannot directly operate
     on/with the stack pointer
   o add the necessary register interference edges for the stack pointer
     register

git-svn-id: trunk@29938 -
2015-02-23 22:54:03 +00:00
Jonas Maebe
5bb89cc2f0 * keep track of the reason why a loadparentfpnode has been created: to
load a value from a nested context, or to pass a context to a nested
    routine. In case a target uses both the stack and frame pointer, this
    difference can matter.

git-svn-id: trunk@29937 -
2015-02-23 22:53:59 +00:00
Jonas Maebe
f6e90ae9bf * include ncgobjc in cpunode for aarch64
git-svn-id: trunk@29935 -
2015-02-23 22:53:53 +00:00
Jonas Maebe
f54ea490dd * fixed writing extended registers in references
git-svn-id: trunk@29933 -
2015-02-23 22:53:47 +00:00
Jonas Maebe
7fc9d775df + support for @page and @pageoffs addressing on AArch64: these are PIC
references that directly take the address of a symbol, rather than
    of its GOT entry
   o use these addressing modes to access local symbols

git-svn-id: trunk@29932 -
2015-02-23 22:53:43 +00:00
Jonas Maebe
70fc5dcee3 * don't pass TP-style objects as HFA or similar, because the calling
convention code is triggered before the object structure has been
    finalised, so the result can be different in the interface and
    implementation. To solve this, something like r20161 has to be
    implemented for TP-style objects

git-svn-id: trunk@29930 -
2015-02-23 22:53:29 +00:00
Jonas Maebe
55bc5d7972 * completed TAoptBaseCpu.RegModifiedByInstruction()
git-svn-id: trunk@29928 -
2015-02-23 22:53:23 +00:00
Jonas Maebe
28a713494c * fixed/completed spilling_get_operation_type
+ implemented spilling_get_operation_type_ref

git-svn-id: trunk@29926 -
2015-02-23 22:53:17 +00:00
Jonas Maebe
5da379ab3f + inlined support for round/trunc on AArch64
git-svn-id: trunk@29923 -
2015-02-23 22:53:07 +00:00
Jonas Maebe
30b0f830c3 * fixed std_param_align
o also updated copyright and architecture name

git-svn-id: trunk@29919 -
2015-02-23 22:52:55 +00:00
Jonas Maebe
5fff543c73 - removed unused taicpu.insoffset field
git-svn-id: trunk@29916 -
2015-02-23 22:52:45 +00:00
Jonas Maebe
71bd4e23d9 + taicpu.op_reg_reg_const_const() and taicpu.op_reg_reg_reg_cond() methods
git-svn-id: trunk@29915 -
2015-02-23 22:52:42 +00:00
Jonas Maebe
5bdd14e252 + AArch64 cputarg
git-svn-id: trunk@29914 -
2015-02-23 22:52:39 +00:00
Jonas Maebe
558b8967b6 + Aarch64 assembler reader
git-svn-id: trunk@29913 -
2015-02-23 22:52:36 +00:00
Jonas Maebe
96fcf6a12d * added BL and CB(N)Z to is_calljmp()
git-svn-id: trunk@29912 -
2015-02-23 22:52:33 +00:00
Jonas Maebe
aa0e2e9170 * fixed cgsize2subreg and cgsize2subreg for mm subreg sizes
git-svn-id: trunk@29911 -
2015-02-23 22:52:30 +00:00
Jonas Maebe
c2b1ff41d5 - removed ARM leftover tspecialregflag type
git-svn-id: trunk@29910 -
2015-02-23 22:52:27 +00:00
Jonas Maebe
4c504098ca + C_CS/C_CC condition and F_HS/F_LO flag aliases
git-svn-id: trunk@29909 -
2015-02-23 22:52:23 +00:00
Jonas Maebe
6e55e8356e + IP0/IP1 register aliases
git-svn-id: trunk@29908 -
2015-02-23 22:52:20 +00:00
Jonas Maebe
bc9b870943 * cpunode: added ncgcal, corrected ncpuinln -> ncpuinl
git-svn-id: trunk@29907 -
2015-02-23 22:52:17 +00:00
Jonas Maebe
1c8059e30c + dummy AArch64 hlcgcpu
git-svn-id: trunk@29906 -
2015-02-23 22:52:14 +00:00
Jonas Maebe
cfd7bfc8a5 + dummy AArch64 cpupi unit
git-svn-id: trunk@29905 -
2015-02-23 22:52:11 +00:00
Jonas Maebe
de2dd592ab + shiftedregmodes and extendedregmodes set constants
git-svn-id: trunk@29892 -
2015-02-23 22:51:28 +00:00
Jonas Maebe
17bcd207af * fixed lowercase entry in uppercond2str
git-svn-id: trunk@29891 -
2015-02-23 22:51:25 +00:00
Jonas Maebe
53548663e3 + AArch64 assembler writer
git-svn-id: trunk@29890 -
2015-02-23 22:51:22 +00:00
Jonas Maebe
d246ababff + condition code operand for aarch64
+ taicpu.op_reg_cond() constructor
  * use this operand for cset

git-svn-id: trunk@29889 -
2015-02-23 22:51:19 +00:00
Jonas Maebe
9c55fa6f6c + FPCR, FPSR and TPIDR registers
git-svn-id: trunk@29878 -
2015-02-23 22:50:44 +00:00
Jonas Maebe
6995474ea0 + aarch64 cpunode
git-svn-id: trunk@29875 -
2015-02-23 22:50:35 +00:00