Commit Graph

462 Commits

Author SHA1 Message Date
Jonas Maebe
08791712d7 * also specify the byval alignment at the callee side
git-svn-id: trunk@41448 -
2019-02-24 19:59:00 +00:00
Jonas Maebe
6071263469 * use ` instead of ^ as replacement character in LLVM asmnodes, as ^ can
appear in ARM inline assembly

git-svn-id: trunk@41446 -
2019-02-24 19:58:54 +00:00
Jonas Maebe
a87a7270d5 * remove double "nocapture" attributes
* also add "noalias nocapture" to sret parameters

git-svn-id: trunk@41445 -
2019-02-24 19:58:51 +00:00
Jonas Maebe
e829596750 * type left-over parts of parameters as arrays of "stack slot alignment" if
they're an exact multiple of the ialignment size on LLVM. This prevents
    both overalignment (e.g. remainder of 8 individual bytes on ARM
    would be aligned to 8 bytes instead of 4 if typed as int64) and
    underalignment (e.g. 32 bytes remainder of a record that needs to be
    aligned to 8 bytes would be aligned to 1 or 4 bytes if types as
    array of resp. bytes or longints)

git-svn-id: trunk@41444 -
2019-02-24 19:58:47 +00:00
Jonas Maebe
f9668f8c03 * let de LLVM parameter manager merge multiple paralocs used to represent a
single ordinal, as such splitting is handled by LLVM itself (and handling
    such split locations is currently not supported by our LLVM code generator)

git-svn-id: trunk@41199 -
2019-02-03 21:00:28 +00:00
Jonas Maebe
503ea604f3 + nolinline modifier to specify that a routine must never be inlined
git-svn-id: trunk@41198 -
2019-02-03 21:00:17 +00:00
Jonas Maebe
e52cf555ab * fix loading of constants in registers in the LLVM CG if the constant
does not fit in ptrsinttype

git-svn-id: trunk@41138 -
2019-01-29 21:39:26 +00:00
Jonas Maebe
a72a12eef6 * don't emit 0-sized parameters for LLVM: clang doesn't either, and some
LLVM backends (like the AArch64 one) trigger internal errors when
    encountering them

git-svn-id: trunk@40736 -
2019-01-01 16:55:41 +00:00
Jonas Maebe
4d03f3a65e * fixed LLVM memory leaks
git-svn-id: trunk@40732 -
2019-01-01 16:22:31 +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
f3d831b480 * fixed result cgsize of LLVM's second_nothing type conversion node (new
size instead of original size, which can be different in case of going
    from void to something else)

git-svn-id: trunk@40632 -
2018-12-24 22:09:58 +00:00
Jonas Maebe
eb769e3859 * force pointer-based self parameters of inlined routines in temps for LLVM
to ensure that their type gets updated

git-svn-id: trunk@40631 -
2018-12-24 22:09:55 +00:00
Jonas Maebe
dd29088430 * simplify all type conversions for formal constants even for LLVM and JVM
(since these happen at compile time and don't result in generated code,
     they never need extra type conversions in the code)

git-svn-id: trunk@40629 -
2018-12-24 22:09:48 +00:00
Jonas Maebe
f87304f5ca * fixed LLVM code generator not taking into account constalignmin/max
settings for typed constants

git-svn-id: trunk@40605 -
2018-12-21 20:57:22 +00:00
Jonas Maebe
4f72edcdd5 + LLVM support for the FMA intrinsics
git-svn-id: trunk@40604 -
2018-12-21 20:57:19 +00:00
Jonas Maebe
1cc995b471 * use ccallnode.createintern() instead of
ccallcnode.createinternfromunit('SYSTEM')

git-svn-id: trunk@40603 -
2018-12-21 20:57:16 +00:00
Jonas Maebe
c55ffa8cc7 * fixed <> comparisons with NaNs (use LLVM "unordered" comparison: succeed
if either operand is a NaN)

git-svn-id: trunk@40602 -
2018-12-21 20:57:12 +00:00
Jonas Maebe
3b4011760a * cleaned up blockaddress instruction (add type rather than hardcoding it
in the assembler writer)
  * fixed taking the address of a label in a typed const for llvm (fixes
    tbs/tb0468a)

git-svn-id: trunk@40599 -
2018-12-20 21:22:44 +00:00
Jonas Maebe
7cc7268635 * fixed dynamic array constants for non-Darwin LLVM platforms
git-svn-id: trunk@40578 -
2018-12-16 20:59:58 +00:00
Jonas Maebe
2330164ee2 + internal sqrt support for LLVM (faster on all platforms, necessary on
platforms that don't have RTL support for it, as the the generic
    fpc_sqrt_real just calls runerror)

git-svn-id: trunk@40575 -
2018-12-16 20:44:41 +00:00
Jonas Maebe
e69b4d2d9a * replaced some stray cpointerdef.create() calls with cpointerdef.getreusable()
git-svn-id: trunk@40572 -
2018-12-16 20:44:31 +00:00
Jonas Maebe
93e39fb0cd * only coerce the type of the leftover bytes of a record if the location
size doesn't match the number of remaining bytes
   o prevents a second "single" field of a record getting interpreted as a
     "cardinal"

git-svn-id: trunk@40569 -
2018-12-16 20:44:21 +00:00
Jonas Maebe
97bc58d248 * fixed bug that caused the "sret" argument attribute to never be used (and
a guaranteed internalerror on AArch64/llvm)

git-svn-id: trunk@40565 -
2018-12-16 20:44:09 +00:00
Jonas Maebe
32a51d7b62 * add nocapture and dereferenceable/dereferenceable_or_null decorators to
parameters for llvm where appropriate

git-svn-id: trunk@40503 -
2018-12-08 15:31:54 +00:00
Jonas Maebe
51502874af * emit temp lifetime information for llvm
o also allow freeing temps in the middle of a routine for llvm (we won't
     reuse them, but it results in better lifetime information)

git-svn-id: trunk@40502 -
2018-12-08 15:31:51 +00:00
Jonas Maebe
8a4947dba2 * don't do anything in thlcgllvm.allocallcpuregisters() like in
deallocallcpuregisters()

git-svn-id: trunk@40499 -
2018-12-08 15:31:41 +00:00
Jonas Maebe
b7da7cd654 * ensure the generic version of tcgshlshrnode gets used for llvm
git-svn-id: trunk@40464 -
2018-12-04 19:53:16 +00:00
Jonas Maebe
50ab607676 + customint torddef type to create arbitraty bit-width integers
o use this to handle non-power-of-two-sized parameters for llvm
   o no general support in the parser/code generator, so don't expose

git-svn-id: trunk@40398 -
2018-11-29 20:57:08 +00:00
Jonas Maebe
97b40dc16d * fixed dynamic array constants for llvm
git-svn-id: trunk@40383 -
2018-11-28 19:23:25 +00:00
Jonas Maebe
413a3599c1 * thlcgobj.g_unreachable() dummy implementation + llvm override
git-svn-id: trunk@40382 -
2018-11-28 19:23:22 +00:00
Jonas Maebe
20fea3607c * pass volatility information to llvm.memcpy
git-svn-id: trunk@40376 -
2018-11-26 22:30:05 +00:00
pierre
23570bed33 Use same parameter type for update_reference_offset override
git-svn-id: trunk@40325 -
2018-11-16 13:26:56 +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
florian
c7a0022146 * fix building with LLVM=1, thanks to Karl-Michael Schindler for the hint
git-svn-id: trunk@39861 -
2018-10-05 20:56:56 +00:00
Jonas Maebe
807fcb3371 * support pasbool8 as type for a record field when a record is passed/
returned in multiple registers (llvm)

git-svn-id: trunk@38862 -
2018-04-28 16:17:37 +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
3da67019e5 * fixed llvm compiler compilation after r38814 (crashes in "make cycle", but
that was already the case before)

git-svn-id: trunk@38815 -
2018-04-22 20:40:19 +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
florian
94de872927 * fix compilation for llvm as proposed by Karl-Michael Schindler, resolves #31969
git-svn-id: trunk@37842 -
2017-12-28 14:57:35 +00:00
Jonas Maebe
e4dbd24a49 + inline trunc() support for the LLVM backend when using -Oofastmath (because
the behaviour of LLVM's fptosi instruction is undefined in case of
    overflow)

git-svn-id: trunk@36275 -
2017-05-20 19:28:15 +00:00
Jonas Maebe
04ac44cd37 - removed dependency of hlcgllvm on llvmpara, so that cpupara no longer
indirectly depends on llvmpara and hence is initialised after instead
    of before it (since llvmpara should override cpupara in its init code)

git-svn-id: trunk@36264 -
2017-05-19 21:52:37 +00:00
svenbarth
c16238e8dd * fix for Mantis #31464: add an entry for the WebAssembly CPU (this is already the target name that LLVM uses)
git-svn-id: trunk@35507 -
2017-03-03 16:14:52 +00:00
Jonas Maebe
4b9179636b + support for creating and writing LLVM landingpad instructions
git-svn-id: trunk@35161 -
2016-12-18 13:57:42 +00:00
Jonas Maebe
28e5636daa + support for LLVM nil assembler symbols in instructions (write as "null")
+ support for LLVM nil tai operands (will be used for terminating a daisy
    chain of catch/filter clauses of landingpads): don't try to write it

git-svn-id: trunk@35160 -
2016-12-18 13:57:39 +00:00
Jonas Maebe
7503c2bd3e * changed llvmgettemprecorddef() to take an open array instead of a tfplist
as list of defs to be stored in the record, so we don't need to create and
    free a class instance every time we call this routine

git-svn-id: trunk@35155 -
2016-12-18 13:57:22 +00:00
Jonas Maebe
b936d8f012 * don't internalerror when performing an LLVM tc_equal conversion from one
TP-style object to another and the sizes differ, at least if they are
    related
  * restructured and commented the LLVM type conversion checks

git-svn-id: trunk@35137 -
2016-12-16 22:38:01 +00:00
Jonas Maebe
f55d962e40 * use system.round() instead of LLVM's fptosui operation for converting a
floating point type to currency, as fptosui is defined as always rounding
    to zero while on other platforms we use the FPU's current rounding mode
    (fixes webtbs/tw21449 for LLVM, and also webtbs/tw24197 because LLVM's
     code generated for fptosui temporarily changes the FPU control word so
     it rounds to zero and also to disable FPU exceptions)

git-svn-id: trunk@35061 -
2016-12-04 11:15:22 +00:00
Jonas Maebe
8b1c90124e * support encoding helper types for LLVM (encode the same type as the
extended class) (fixes webtbs/tw21457 for LLVM)

git-svn-id: trunk@35060 -
2016-12-04 11:15:19 +00:00
Jonas Maebe
a0b537bc7b * fixed typed constants that use an integer number to initialise a procvar or
pointer on LLVM (fixes webtbs/tw21267)

git-svn-id: trunk@35059 -
2016-12-04 11:15:15 +00:00
Jonas Maebe
a8e107bb4b * fix memory leak: free rg[R_MMREGISTER]
git-svn-id: trunk@35056 -
2016-12-04 11:15:05 +00:00