Commit Graph

216 Commits

Author SHA1 Message Date
Jonas Maebe
7f2750f188 * missing part of r24776, using a build server also has pitfalls :/
git-svn-id: trunk@24777 -
2013-06-02 14:35:29 +00:00
Jonas Maebe
9938169d2c * don't use the paracgsize in get_paraloc_def(), because it generally
contains the tcgsize of the entire parameter rather than only of
    what is left (-> calculate it from the remaining parameter length)

git-svn-id: trunk@24776 -
2013-06-02 14:05:07 +00:00
sergei
4b820a1ca5 - Removed tcgloadnode.generate_picvaraccess, it is never used and is not necessary because PIC stuff is handled at lower levels.
git-svn-id: trunk@24764 -
2013-06-02 10:49:17 +00:00
Jonas Maebe
7566ddcc8f * add a tdef to each parameter location and set it for all target
backends (not yet used, will be used in high level code generator)

git-svn-id: trunk@24761 -
2013-06-02 10:24:02 +00:00
nickysn
a03f0d84ea high level code generator: const types changed from aint to tcgint to avoid problems on < 32-bit cpus; ppcjvm should also be updated, but isn't yet
git-svn-id: branches/i8086@23761 -
2013-03-09 22:16:03 +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
florian
7ac9f11cc7 * check if current_procinfo is assigned in paramanager code to avoid crashes
git-svn-id: trunk@23303 -
2013-01-03 23:00:03 +00:00
masta
e327b4581c Use TRegNameTable instead of array[tregisterindex] of string[10]
TRegNameTable is defined in compiler/rgbase.pas and is an array of
strings, limited to the maximum length of the used register names.

r22792 added a long register name but did not scale the string-size
enough, resulting in the compiler built breaking for arm.

git-svn-id: trunk@22817 -
2012-10-22 10:23:21 +00:00
Jeppe Johansen
0087661fb5 Added FPv4_d16 FPU instructions, and a few extra registers
git-svn-id: branches/laksen/arm-embedded@22596 -
2012-10-08 20:04:14 +00:00
florian
7361e19799 + support for handling OS_128/OS_S128 on 64 Bit CPUs as far as needed for method pointers in registers
git-svn-id: trunk@22344 -
2012-09-06 15:12:12 +00:00
florian
4dee21c60e + NR_DEFAULTFLAGS and RS_DEFAULTFLAGS for all CPUs with flags added
git-svn-id: trunk@22181 -
2012-08-22 19:38:27 +00:00
florian
4d86d25c6c * -O4 switch for optimizations which are correct but which might have unexpected effects
like field reordering (possible problems cracker classes) or using ebp as normal register (broken
      stack traces from dump_stack)
    + niln is also valid in a cse domain
    * parameters passed by reference shall have a complexity >1
    * load nodes from outer scopes shall have a complexity >1
    * better cse debugging
    + more node types added to cse
    * consider parameters passed by reference in cse
    * take care of cse in parameters in simple cases

git-svn-id: trunk@22050 -
2012-08-09 18:58:54 +00:00
florian
b330bba0bc + introduce -Oofastmath
* limit the application of the tree transformation introduced in r21986 to safe cases and -Oofastmath

git-svn-id: trunk@22040 -
2012-08-08 19:35:45 +00:00
Jonas Maebe
0a1157da38 * fixed memory leaks in the compiler introduced in r21862 by marking and
releasing temporarily created function result locations

git-svn-id: trunk@21953 -
2012-07-23 13:49:29 +00:00
Jonas Maebe
3798b79fd7 + optimization that (re)orders instance fields of Delphi-style classes in
order to minimise memory losses due to alignment padding. Not yet enabled
    by default at any optimization level, but can be (de)activated separately
    via -Oo(no)orderfields
   o added separate tdef.structalignment method that returns the alignment
     of a type when it appears in a record/object/class (factors out
     AIX-specific double alignment in structs)
   o changed the handling of the offset of a delegate interface
     implemented via a field, by taking the field offset on demand
     rather than at declaration time (because the ordering optimization
     causes the offsets of fields to be unknown until the entire
     declaration has been parsed)

git-svn-id: trunk@21947 -
2012-07-22 16:47:19 +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
c3ea451aea * set tcgpara.vardef when creating parameter info
git-svn-id: trunk@21693 -
2012-06-24 15:01:54 +00:00
Jonas Maebe
2d48396587 - removed redundant checks
git-svn-id: trunk@21692 -
2012-06-24 15:01:48 +00:00
Jonas Maebe
587244c088 * factored out common code from get_funcretloc()
* set tcgpara.def for the function return location (field introduced for and
    already used by the JVM code generator, required for future hlcg
    functionality)

git-svn-id: trunk@21691 -
2012-06-24 15:01:42 +00:00
Jonas Maebe
708a2532fc * consistently define empty saved_mm_registers arrays as containing a single
RS_INVALID superregister (instead of sometimes RS_NO and sometimes
    RS_INVALID)
  * check for RS_INVALID in tcg.g_save_registers() and ignore such entries

git-svn-id: trunk@21622 -
2012-06-15 18:24:25 +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
85a3fd3357 + ossinttype/osuinttype defs that correspond to OS_SINT/OS_INT for use in
the high level code generator

git-svn-id: trunk@21279 -
2012-05-12 16:03:15 +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
0278d67764 * use generic ppc version of a_loadaddr_ref_reg() for AIX/ppc64
* also recognize addr_pic_no_got as a PIC'ed address

git-svn-id: trunk@21052 -
2012-04-25 20:28:27 +00:00
Jonas Maebe
b33b744f78 * enabled null pointer load checking for AIX/ppc64
git-svn-id: trunk@21051 -
2012-04-25 20:28:23 +00:00
Jonas Maebe
cec20e1c34 * specify the branch opcode to use for a_call_name_direct/a_jmp_name_direct,
because it's sometimes different for AIX and other platforms (AIX uses
    absolute branches for entry/exit code helpers)

git-svn-id: trunk@21050 -
2012-04-25 20:28:18 +00:00
Jonas Maebe
d43387dff8 * equivalent of r20829 for AIX/ppc64 (and linux/ppc64): automatically create
dotted names when calling functions from assembler

git-svn-id: trunk@21046 -
2012-04-25 20:28:00 +00:00
Jonas Maebe
d08a17b763 * AIX requires record data that partially fills a register to be
left-aligned. Other targets only require this if the total size of the
    parameter was > 8 bytes (this last part used to be ensured by
    the ppc64-specific version of a_load_ref_cgpara() that was removed in
    r20962)

git-svn-id: trunk@21008 -
2012-04-23 21:14:38 +00:00
Jonas Maebe
426d44905e * add symtable to uses clause for tabstractsymtable, part of r20967
(fixes powerpc64 compiler compilation)

git-svn-id: trunk@20981 -
2012-04-22 10:41:02 +00:00
Jonas Maebe
5dac788b71 * use tabstractrecordsymtable.has_single_field() to determine whether a
record has only a single field (and if so, which one) when checking
    whether we have to treat the record as if it was actually its first
    field that's passed as a parameter (fixes problems with records
    with methods, e.g. crash while compiling tests/test/trhlp35)

git-svn-id: trunk@20967 -
2012-04-21 20:18:08 +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
a473cf14d6 - removed ppc64-specific a_load_ref_cgpara(), the generic one can also
handle of its special cases nowadays

git-svn-id: trunk@20962 -
2012-04-21 20:17:40 +00:00
Jonas Maebe
8c27e280e9 * pocall_mwpascal is the same as cdecl/cppdecl -> handle it the same for
varargs

git-svn-id: trunk@20947 -
2012-04-20 21:23:01 +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
247033cce1 + stabx support for AIX, which is a variant of stabs. Note that we only
support the stabx as understood by gdb, which is a mixture of regular
    stabs and stabx (e.g., class/object definitions are completely different
    in real stabx). This means that gdb can be used to debug aix programs,
    but the native dbx will complain about lots of debug information
    constructs

git-svn-id: trunk@20842 -
2012-04-11 18:06:38 +00:00
Jonas Maebe
23df85e52a * initialize dirhint field of created tasmconds
git-svn-id: trunk@20800 -
2012-04-11 18:01:49 +00:00
Jonas Maebe
71106219f2 * detect RTOC-based accesses on AIX in inline assembly, and change the
symbol names to those of the associated TOC entries

git-svn-id: trunk@20797 -
2012-04-11 18:01:29 +00:00
Jonas Maebe
4123df9cb8 * moved g_external_wrapper() code from powerpc64/cgcpu to ppcgen/cgppc,
made it 32/64 bit neutral and adjusted it so it can be used for
   linux/ppc64, aix/ppc and aix/ppc64

git-svn-id: trunk@20795 -
2012-04-11 18:01:14 +00:00
Jonas Maebe
95966da949 + AIX support for a_call_reg()
* renamed some ppc64 stackframe offset constants to the same names as their
    32 bit counterparts so they can be used in shared ppc code

git-svn-id: trunk@20794 -
2012-04-11 18:01:01 +00:00
Jonas Maebe
462de0f5fd + AIX target definition and info for the compiler and ppudump
git-svn-id: trunk@20790 -
2012-04-11 18:00:29 +00:00
florian
2f5ce095ce * RefsHaveIndexReg -> cpurefshaveindexreg
* cpurefshaveindexreg defined properly in fpcdefs.inc

git-svn-id: trunk@20504 -
2012-03-10 19:43:52 +00:00
florian
aa529b0705 * fix fullcycle after -Sew for the compiler was introduced
git-svn-id: trunk@19757 -
2011-12-04 21:17:40 +00:00
Jonas Maebe
84c23f6b42 * fixed range check warning when doing a native ppc64 compile
git-svn-id: trunk@19595 -
2011-11-04 22:49:04 +00:00
florian
4868b09844 * patch by alexvin to replace $ifopt by $push/$pop, resolves #20332
git-svn-id: trunk@19239 -
2011-09-25 21:19:50 +00:00
Jonas Maebe
72e9cfee24 * create/destroy also the high level code generator for all architectures,
so it can be used in generic code

git-svn-id: branches/jvmbackend@18280 -
2011-08-20 07:21:16 +00:00
pierre
af098d08d5 * Avoid pointer to signed integer warning
git-svn-id: trunk@17895 -
2011-07-01 11:55:05 +00:00
Jonas Maebe
5175a5ee07 * handle LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF in
unaryminus code (a.o., fixes compiler crash with test/terecs6 on
    darwin/ppc32 under certain circumstances:
    http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi?action=3&run1id=74027&run2id=74101&testfileid=3838 )

git-svn-id: trunk@16650 -
2010-12-28 23:52:25 +00:00
tom_at_work
446eacaf47 * another compilation failure due to cleanup of changes to r16272
git-svn-id: trunk@16281 -
2010-10-31 18:37:49 +00:00
tom_at_work
f1a7cf78fe * fixed compilation after cleaning up for r16272
git-svn-id: trunk@16280 -
2010-10-31 18:26:33 +00:00
tom_at_work
e215b215d6 * fix code generation for interface wrappers: adjustment of self pointers with offsets > 16 bit crashed because it tried to allocate a virtual register, but the register allocator is not called for these wrappers. Always use the R11 register, which is scratch on ppc64, for now.
git-svn-id: trunk@16272 -
2010-10-31 14:47:42 +00:00