Commit Graph

138 Commits

Author SHA1 Message Date
Jonas Maebe
faf75095cd * synchronised with trunk till r42189
git-svn-id: branches/debug_eh@42190 -
2019-06-07 18:24:38 +00:00
Jonas Maebe
1dee4c41dd - removed "cmp 0/1, pasbool1" optimization for llvm because this discards
the upper 7 bits of the boolean, while other platforms take it into
    account (even though they're technically always required to be 0, and
    the value is undefined if they're not)

git-svn-id: trunk@42189 -
2019-06-07 18:17:55 +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
024b38e1ff * fixed setting calling convention for calls (the callpd passed to the
taillvm constructors is not necessarily a proc(var)def)

git-svn-id: branches/debug_eh@41979 -
2019-05-02 19:45:30 +00:00
Jonas Maebe
fcde89cb26 * support forcing to write the parameter alignment for parameters for LLVM,
even when it's the same as the stack alignment (it can also refer to the
    alignment of the data pointed to by pointer parameters)

git-svn-id: branches/debug_eh@41729 -
2019-03-17 15:28:27 +00:00
Jonas Maebe
3b254affb7 * support for the individual alignment flags for the memcpy intrinsic of
LLVM 7.0

git-svn-id: branches/debug_eh@41728 -
2019-03-17 15:28:23 +00:00
Jonas Maebe
a0831b058a * fixed LLVM para loading for byval paralocs that are preceded by other
paralocs

git-svn-id: branches/debug_eh@41217 -
2019-02-03 21:10:18 +00:00
Jonas Maebe
af098474f4 * keep track of the alignment requirements of parameters with LLVM, and emit
them when they are different from the default

git-svn-id: branches/debug_eh@41216 -
2019-02-03 21:10:14 +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
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
14cc517f40 * synchronised with trunk till r40724
git-svn-id: branches/debug_eh@40737 -
2019-01-01 17:15:29 +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
473fef315d * synchronised with trunk till r40732
git-svn-id: branches/debug_eh@40733 -
2019-01-01 16:24:18 +00:00
Jonas Maebe
4d03f3a65e * fixed LLVM memory leaks
git-svn-id: trunk@40732 -
2019-01-01 16:22:31 +00:00
Jonas Maebe
1a0ffbc82b * fixed llvm compiler compilation with -O3/-Oodfa
git-svn-id: branches/debug_eh@40590 -
2018-12-18 21:13:56 +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
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
440026bb25 * synchronised with trunk till r40503
git-svn-id: branches/debug_eh@40504 -
2018-12-08 15:33:36 +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
fceb34dbd5 * converted tllvmpara contents from tlocation to toper, so we can also
store tai in them
  + support for direct symbol parameters to llvm routines (without first
    loading them into register)
   o needed to pass such symbols to llvm intrinsics

git-svn-id: branches/debug_eh@40414 -
2018-11-29 21:31:27 +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
ccb7231744 * generate invoke instead of call when calling a function in a block that
catches exceptions

git-svn-id: branches/debug_eh@40405 -
2018-11-29 21:30:59 +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
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
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
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
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
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
7ebbb744e9 * also specify sret attribute at the caller side
git-svn-id: trunk@34302 -
2016-08-13 14:47:42 +00:00
Jonas Maebe
819f0c39fa * specify the "byval" attribute also at the caller side
git-svn-id: trunk@34301 -
2016-08-13 14:47:39 +00:00
Jonas Maebe
f417ed6576 * internalerror in case a reference's alignment is not set in
thlcgllvm.make_simple_ref_ptr()

git-svn-id: trunk@34299 -
2016-08-13 14:47:34 +00:00
Jonas Maebe
2f0c3ce8cc * fixed updating the reference alignment in thlcgllvm.g_set_addr_nonbitpacked_field_ref()
git-svn-id: trunk@34298 -
2016-08-13 14:47:31 +00:00
Jonas Maebe
a83f3c1a45 * fix maximum common alignment calculation in g_concatcopy() (if the second
parameter of newalignment() is larger than the first, the result is always
    1)

git-svn-id: trunk@34295 -
2016-08-13 14:47:23 +00:00
Jonas Maebe
f4015f6ac9 * fixed wrong class cast in case arrays/records are passed to a_loadfpu*()
(fixes tests/webtbs/tw26993.pp for llvm)

git-svn-id: trunk@34280 -
2016-08-12 13:35:31 +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
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
687adbefd7 + support for LOC_VOID parameters in llvm for empty records (fixes
tests/test/tnoext4.)

git-svn-id: trunk@34136 -
2016-07-15 14:35:17 +00:00
Jonas Maebe
c05fa52775 * call g_concatcopy() from a_load_ref_ref() if the size of the to be copied
data is big, because large load/store operations result in very slow code
    (and takes forever to generate by llc)

git-svn-id: trunk@34135 -
2016-07-15 14:34:43 +00:00
Jonas Maebe
88a736c95a * moved the code generated for library init/fini to the al_pure_assembler
list, so that the assembler directives generated for Darwin are emitted
    correctly for LLVM
   o extracted the library init code generation from hlcgobj to pmodules so
     we don't add things to another list than what's passed to
     gen_proc_symbol_end(), and so it's done where we generate the init
     routine for libraries (rather then checking for every routine whether
     it's the init routine for a library)
   o removed the llvm-specific gen_proc_symbol_end() because the regular one
     now does the same

git-svn-id: trunk@34134 -
2016-07-15 14:34:11 +00:00
Jonas Maebe
c7ea921066 * renamed thlcgobj.g_external_wrapper() into a_jmp_external_name(), and
moved the code to create the procedure start/end etc. that was at the
    call sites of g_external_wrapper() into the new g_external_wrapper()
    -> got rid of the x86-specific code in expunix, and fixed expunix for
    llvm (e.g. tests/test/tlib1{a,b})

git-svn-id: trunk@34131 -
2016-07-14 15:26:40 +00:00
Jonas Maebe
9b7e7c5298 + support absolute addresses on llvm (fixes tests/webtbs/tw12685 for llvm)
git-svn-id: trunk@34124 -
2016-07-14 15:22:31 +00:00
Jonas Maebe
458ba2efac * unlike other architectures, llvm requires that both operands of shl/shr are
of the same size -> ensure that this is the case for the shifts in
    a_bit_test/set_reg_reg_reg() (fixes tests/tbs/tb0219.pp for llvm)

git-svn-id: trunk@34123 -
2016-07-14 15:21:37 +00:00
Jonas Maebe
2148a20d6a * fixed returning results from functions that have a zero-sized result
(e.g. an empty record): return an "undefined" instance of the result
    type (since it's empty, its contents are irrelevant). Before, we
    returned "void", but that means returning nothing rather than returning
    something empty (part of fixing test/tnoext4 for llvm)

git-svn-id: trunk@34119 -
2016-07-14 15:19:09 +00:00
Jonas Maebe
571d053a60 - removed tabstractnormalvarsym.currentregloc: the new location will
always be different from the old location, since we just allocated
    the registers for the new one above. Should the old registers ever
    be needed again for tai_varloc: rr.old/rr.oldhi contains it

git-svn-id: trunk@34086 -
2016-07-08 07:46:51 +00:00
Jonas Maebe
b5cb7a5d4f * factored out loading of integers from memory into structs in registers or
vice versa, and generalised for floating point and mm registers
    (webtbs/tw26993.pp)

git-svn-id: trunk@34031 -
2016-06-30 15:33:37 +00:00
Jonas Maebe
eeae34ea7d * simplified handling of loading a reference into a register of a
larger size in case of structured types
   o also fixes the logic for big endian

git-svn-id: trunk@34029 -
2016-06-30 15:33:31 +00:00
Jonas Maebe
f2c1e4234f * use g_ptrtypecast_ref() in a_load_ref_reg() when we have to typecast
references

git-svn-id: trunk@34028 -
2016-06-30 15:33:27 +00:00