Commit Graph

154 Commits

Author SHA1 Message Date
Jonas Maebe
9079227c56 * don't give an internalerror when trying to prefetch a regvar or even
something without a location at all; it's a hint/optional operation,
    so if there's nothing to prefetch just don't do anything
    (mantis #27811)

git-svn-id: trunk@30502 -
2015-04-08 20:35:13 +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
f633d094ee * perform interface dispatches via R12 instead of R11 as expected for
indirect function calls for ELFv2 (and other ABIs don't care about
    the register)

git-svn-id: trunk@30236 -
2015-03-15 14:00:32 +00:00
Jonas Maebe
eee83ebb4a * use generic code for a_load_subsetref_regs_noindex on ppc64le
git-svn-id: trunk@30216 -
2015-03-14 18:36:26 +00:00
Jonas Maebe
cf5b42b4b2 * use generic code for set+setelement on ppc64le
git-svn-id: trunk@30214 -
2015-03-14 18:36:20 +00:00
Jonas Maebe
5a6b9c9f16 * store/reload toc around indirect calls for ELFv2 ABI
* ensure that register calls happen via R12 on the ELFv2 ABI

git-svn-id: trunk@30207 -
2015-03-14 18:35:59 +00:00
Jonas Maebe
fb27dff638 * generate ".abiversion 2" directive when targeting ppc64/ELFv2
* generate code to load the TOC register if it's required, and
    emit the the ".localentry" directive to indicate to the linker
    where the actual function body starts
  * support the ".localentry" directive in the ppc64 assembler reader
   o disable the fpc_qword_to_double() assembler implementation for
     ELFv2, because we can't manually insert the .localentry directive
     before the stack allocation code
  * perform indirect calls on ppc64 via R12 in ncgcal, as R12 needs to
    contain the function address on entry on ppc64/ELFv2 (and it's
    a volatile register, so there's no problem with always using
    it)

git-svn-id: trunk@30198 -
2015-03-14 18:35:31 +00:00
Jonas Maebe
1e227f78fe * factored out the check for whether we have to generate dotted function
names, and disabled them for ppc64 ELFv2
  * disabling those also disables the function descriptors, so use the
    _CALL_ELF compiler variable to check whether there is in fact a
    function descriptor

git-svn-id: trunk@30196 -
2015-03-14 18:35:25 +00:00
Jonas Maebe
fc21845686 * fixed the allocation of R12 on ppc32/ppc64 when used to hold the value of
the stack pointer during the prolog. This was done previously in
    tcg.g_proc_entry(), but that routine is called after register allocation
    and hence has no influence. Also cleaned up the deallocation of that
    register by moving the previously ifdef'd code to thlcgppcgen
    (mantis #27634)

git-svn-id: trunk@30164 -
2015-03-11 17:49:44 +00:00
Jonas Maebe
6a70c84258 + internal bsr/bsf support for ppc32 and ppc64
git-svn-id: trunk@30152 -
2015-03-09 16:48:34 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
florian
d540d56908 * unified internal errors
git-svn-id: trunk@29280 -
2014-12-13 11:46:59 +00:00
Jonas Maebe
b745dcc64c * moved g_external_wrapper() to the hlcg, and also g_intf_wrapper() because
for some platforms it depends on that routine

git-svn-id: branches/hlcgllvm@28492 -
2014-08-19 20:22:54 +00:00
Jonas Maebe
979a3d7e1d * channged gettemptyped() into gethltemp() call, as gettemptyped() is only
intended/required for managed types

git-svn-id: branches/hlcgllvm@28483 -
2014-08-19 20:22:29 +00:00
Jonas Maebe
5c75b6dd6b * synchronised with trunk up till r28402
git-svn-id: branches/hlcgllvm@28403 -
2014-08-13 16:04:30 +00:00
Jonas Maebe
0867b6e4f8 * added missing {$i fpcdefs.inc}
git-svn-id: branches/hlcgllvm@28378 -
2014-08-10 19:40:34 +00:00
Jonas Maebe
d5895a4d98 - removed ppc-specific a_load_const_cgpara: not necessary, and in fact wrong
in case the para location size is larger than the source size

git-svn-id: trunk@28250 -
2014-07-23 14:06:03 +00:00
sergei
e4fea2ebc8 * Dummy implementations of a_bit_scan_reg_reg and g_stackpointer_alloc in tcg, removes the need to override these methods in every descendant code generator solely to avoid "constructing a class with abstract method" warning.
git-svn-id: trunk@28175 -
2014-07-06 11:34:04 +00:00
Jonas Maebe
bacd303208 * synchronized with trunk up to r27758
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
pierre
19ba1b43a1 Add possibility to use GNU assembler gas on naitve AIX
git-svn-id: trunk@27632 -
2014-04-22 15:48:55 +00:00
pierre
d7c5b4502f Fix AIX assembler issue by enabling WriteExtraFooter with modified output
git-svn-id: trunk@27620 -
2014-04-20 23:08:38 +00:00
Jonas Maebe
e0a910e813 * factored out left/right swapping code in smallset operations
* force the left operand into a register if both the left and
    right are constants (can happen because not all set add-nodes
    are handled in taddnode.simplify) because the code below
    expects at least one register operand. Fixes the compilation of a.o.
    taddset2 with -O3 on ppc (constant propagagation -> 2 constant
    operands)

git-svn-id: trunk@27607 -
2014-04-20 14:35:00 +00:00
sergei
5fe27ae815 * powerpc/powerpc64: Fixed floating point compares to be IEEE-754 compliant. Mantis #9362.
git-svn-id: trunk@27604 -
2014-04-19 19:54:24 +00:00
sergei
a8eb55fa7c * powerpc/powerpc64: merged identical a_jmp_flags methods into base code generator class.
git-svn-id: trunk@27598 -
2014-04-19 18:34:10 +00:00
sergei
c0431dba4e * Moved method g_flag2reg from tcgppc (in both powerpc and powerpc64) to tcgppcgen class, since it is identical for both targets.
git-svn-id: trunk@27589 -
2014-04-16 15:00:49 +00:00
Jonas Maebe
4065483a50 * completed thlcgobj.location_force_fpureg(), use it everywhere and removed
ncgutil/thlcg2ll.location_force_fpureg()

git-svn-id: trunk@27071 -
2014-03-10 09:01:05 +00:00
Jonas Maebe
e9268a0a14 * synchronised with trunk up till r26975
git-svn-id: branches/hlcgllvm@26976 -
2014-03-06 21:36:58 +00:00
Jonas Maebe
de0ced1522 * A_INSLWI, A_INSLWI_, A_INSRWI, A_INSRWI_ also modify operand 0
git-svn-id: trunk@26652 -
2014-02-02 15:32:00 +00:00
pierre
3f33fdd445 Handle asmextraopt in powerpc assmeblers
git-svn-id: trunk@26541 -
2014-01-21 00:17:56 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
Jonas Maebe
5ef93e85b8 + added extra "orgsupreg" parameter to do_spill_read/do_spill_written/
do_spill_replace routines, will be necessary by llvm register
    allocator to determine the tdef corresponding to that register
  * replaced uses of taicpu with tai_cpu_abstract_sym in the register
    allocator so that it can work both with taicpu and taillvm instructions

git-svn-id: branches/hlcgllvm@26043 -
2013-11-11 11:15:43 +00:00
Jonas Maebe
57cdd8c106 * set symbol type/binding of data referred by ppc and arm/darwin stubs (part
of r25264, fixes internalerror 2013081601 after r25266)

git-svn-id: trunk@25275 -
2013-08-17 16:26:37 +00:00
Jonas Maebe
3b9b6a0cd7 * explicitly define the asmsymbols for Darwin call stubs as local
git-svn-id: trunk@25264 -
2013-08-16 10:07:46 +00:00
Jonas Maebe
2dd75e707e * renamed thlcgobj.tcgsize2orddef to defutil.cgsize_orddef
git-svn-id: trunk@24743 -
2013-06-01 18:28:15 +00:00
Jonas Maebe
69c29a415f * pass the procdef to getintparaloc instead of only the proccalloption, so
that the type of the parameters can be determined automatically
   o added compilerproc declarations for all helpers called in the compiler
     via their assembler name, so we can look up the corresponding procdef

git-svn-id: trunk@23325 -
2013-01-06 15:05:40 +00:00
Jonas Maebe
6497d3c994 - removed no longer used/supported af_allowdirect flag (direct assembler
reader support)

git-svn-id: trunk@22794 -
2012-10-21 13:42:58 +00:00
florian
283ff05127 * merged avx support in inline assembler developed by Torsten Grundke
git-svn-id: trunk@22568 -
2012-10-06 19:47:18 +00:00
Jonas Maebe
952ac1ffa6 * only use indirect symbol loads for (weak)external and private_external
symbols on darwin/ppc and darwin/i386, and also for common symbols on
    darwin/ppc, as they're not required for other kinds of symbols on those
    platforms (gcc doesn't use them either with -O1 and higher; it does use
    them always for darwin/ppc64 except for local symbols, and hence so do we)

git-svn-id: trunk@22271 -
2012-08-30 21:30:38 +00:00
Jonas Maebe
2be5c8b9af * same change as in r22240 for darwin/ppc(64)
git-svn-id: trunk@22246 -
2012-08-26 08:58:48 +00:00
Jonas Maebe
7a0ae38700 + also specify the parameter def when allocating a parameter via
getintparaloc + adapted all call sites of getintparaloc. This
    led to a number of additional, related changes:
   o corrected the type information for some getintparaloc parameters
   o don't allocate some intparalocs in cases they aren't used
   o changed "const tvardata" parameter into "constref tvardata" for
     fpc_variant_copy_overwrite to make pass-by-reference semantics
     explicit
   o moved a number of routines that now have to call find_system_type()
     from cgobj to hlcgobj so that cgobj doesn't have to start depending
     on the symtable unit
   o added versions of the cpureg alloc/dealloc methods to hlcgobj that
     call through to their cgobj counter parts, so we can call save/restore
     the cpu registers before/after calling system helpers from hlcgobj
     (not implemented in hlcgobj itself, because all basic register
      allocator functionality is still part of cgobj/cgcpu)

git-svn-id: trunk@21696 -
2012-06-24 15:02:12 +00:00
Jonas Maebe
f2c82e32cd - removed g_indirect_sym_load() from hlcgobj/hlcg2ll because this cgobj
method is only used anymore internally in cgobj.tcg and its descendants
  * made tcg.g_indirect_sym_load() protected to ensure it stays that way

git-svn-id: trunk@21392 -
2012-05-26 11:32:33 +00:00
Jonas Maebe
edd42aa42a * moved subsetref/reg and bit_set/test support from cgobj to hlcgobj for
future use by high level code generator targets
   o this in turn required that all a_load*_loc* methods are called via
     hlcg rather than via cg, since a location can be a subsetref/reg and
     and those are no longer handled in tcg
   o that then required moving several force_location_* routines into
     thlcg because they use a_load_loc*, but did not take tdef size
     parameters (which are required by the thlcg a_load_loc* routines)
   o the only practical consequence is that from now on, you have to
     use hlcg.location_force_mem/reg() (fpureg not yet) and
     hlcg.gen_load_loc_cgpara() instead of the removed versions from ncgutil,
     and hlcg.a_load*loc*() instead of cg.a_load*loc* if a subsetref/reg
     might be involved

git-svn-id: trunk@21287 -
2012-05-13 12:33:10 +00:00
Jonas Maebe
834026bfb5 * synchronised with trunk up to r21067
git-svn-id: branches/jvmbackend@21068 -
2012-04-26 21:24:20 +00:00
Jonas Maebe
52d1172f6d * correctly call assembler for AIX/ppc64
* corrected target flags for AIX/ppc64
  * corrected some file extensions for AIX/ppc64

git-svn-id: trunk@21047 -
2012-04-25 20:28:05 +00:00
Jonas Maebe
b99a8c129d * write pointer data on AIX/ppc64 using .vbyte rather than using .llong
(= equivalent of gas .quad), because .llong forces the alignment to
    8 bytes and this causes problems with some typed constant records (such
    as RTTI)

git-svn-id: trunk@21045 -
2012-04-25 20:27:56 +00:00
Jonas Maebe
3380b58695 * when we get near the limit of the maximum number of TOC entries that can
be generated for a single object file on AIX, automatically switch to
    an indirection scheme that uses much less TOC entries, but is slower to
    access global variables
  * manually merged infrastructure for target-specific code generation
    switches from JVM branch (-CTxxx switches)
  * -CTsmalltoc switch for AIX that forces the indirection scheme for TOC
    entries from the start in case the automatic one does not conserve
    a sufficient amount (or in case you bump up against the global TOC
    entries limit during linking)

git-svn-id: trunk@20963 -
2012-04-21 20:17:46 +00:00
Jonas Maebe
aee5380ae0 * merged trunk up to r20882
o support for the new codepage-aware ansistrings in the jvm branch
   o empty ansistrings are now always represented by a nil pointer rather than
     by an empty string, because an empty string also has a code page which
     can confuse code (although this will make ansistrings harder to use
     in Java code)
   o more string helpers code shared between the general and jvm rtl
   o support for indexbyte/word in the jvm rtl (warning: first parameter
     is an open array rather than an untyped parameter there, so
     indexchar(pcharvar^,10,0) will be equivalent to
     indexchar[pcharvar^],10,0) there, which is different from what is
     intended; changing it to an untyped parameter wouldn't help though)
   o default() support is not yet complete
   o calling fpcres is currently broken due to limitations in
     sysutils.executeprocess() regarding handling unix quoting and
     the compiler using the same command lines for scripts and directly
     calling external programs
   o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
     to the make command line

git-svn-id: branches/jvmbackend@20887 -
2012-04-15 15:54:10 +00:00
Jonas Maebe
1c91a555f4 + support for asd_reference, asd_weak_reference and asd_weak_definition
in AIX assembler writer

git-svn-id: trunk@20836 -
2012-04-11 18:06:09 +00:00
Jonas Maebe
7aa3b99fb5 + -CN/{$CHECKLOWADDRLOADS+/-} switch to enable explicit checks for accesses
to low addresses in case the target cpu/OS does not support this (enabled
    for reads on AIX/PPC because on AIX the first 16KB are readable)

git-svn-id: trunk@20832 -
2012-04-11 18:05:50 +00:00