Commit Graph

162 Commits

Author SHA1 Message Date
Jonas Maebe
a32605bd38 * don't force setelementn's into a 32 bit modifiable register if they were
already in a register, as this changes the result location into a size
    different from what resultdef says (and only in that specific case)
   o modified the ppc code so that it always forces a setelementn to uinttype,
     as that is the size that is expected by the operations later on

git-svn-id: trunk@32296 -
2015-11-12 20:55:33 +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
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
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
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
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