Commit Graph

126 Commits

Author SHA1 Message Date
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
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
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
Jonas Maebe
273b90fc37 + AIX assembler writer
o .short/.long/.llong are automatically aligned to 2/4/8 byte multiples
     by the AIX assembler (and for compatibility reasons, also by the
     GNU assembler when targeting AIX) -> change to .vbyte statements
  o .ascii does not allow non-ASCII characters in the AIX assembler
    -> change to .byte sequences like gcc on AIX

git-svn-id: trunk@20803 -
2012-04-11 18:02:08 +00:00
Jonas Maebe
ac43eb9b70 + generic implementation of ReplaceForbiddenAsmSymbolChars() instead
of the AVR-specific ifdef'ed variant
   o since the only special character we use in mangled names on all platforms
     is $, added a new field to tasminfo called "dollarsign" that holds the
     character $'s should be replaced with (if it doesn't have to be replaced,
     leave it at $)

git-svn-id: trunk@20801 -
2012-04-11 18:01:57 +00:00
Jonas Maebe
b738657bf3 * on AIX, functions are called via function descriptors whose name
is '.' followed by the function symbol name (like on linux/ppc64)

git-svn-id: trunk@20796 -
2012-04-11 18:01:21 +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
509df28361 + AIX symbol handling: load symbol address from the TOC
* fixed code dealing with symbol+offsets on 64 bit platforms in
    case of offsets > 32 bit (and to use smallint() typecasts
    instead of lo(), since the return value of lo() depends on
    the type passed in)

git-svn-id: trunk@20793 -
2012-04-11 18:00:48 +00:00
Jonas Maebe
639aa0c0c2 * fixed 64 bit boolean operations on ppc32 (fixes tests/test/taddbool)
git-svn-id: trunk@20521 -
2012-03-15 18:51:03 +00:00
pierre
8319972722 Override abstract method to abvoid warning at compilation time and suppress warning about macos_direct_globals constant
git-svn-id: trunk@19581 -
2011-11-03 10:10:11 +00:00
florian
d7f7a9bb76 * patch by Alexander Shishkin to clean up $ifopt usage by $push/$pop, resolves #20346
git-svn-id: trunk@19256 -
2011-09-27 20:22:40 +00:00
florian
a1b7ec0999 * forgot again part of a commit, this belongs to r18962
git-svn-id: trunk@18963 -
2011-09-03 20:42:01 +00:00
florian
6d996bf832 * made a_call_ref of PowerPC generic, we need to allocate a register after all on risc platforms
git-svn-id: trunk@18962 -
2011-09-03 20:37:53 +00:00
Jonas Maebe
28740dce2d - removed extra "fordefinition" parameter again from tprocdef.mangledname(),
since the definition-specific adorning of JVM mangled names is Jasmin-
    specific, and such code has no place in symdef
  * moved code to adorn JVM mangled names for Jasmin definitions to agjasmin

git-svn-id: branches/jvmbackend@18346 -
2011-08-20 07:49:31 +00:00
Jonas Maebe
b023627f6a * converted tcgcasenode.pass_generate_code() to hlcgobj
o changed type of opsize field of tcgcasenode from tcgsize into tdef,
     and fixed compilation of other code generator units after this change

git-svn-id: branches/jvmbackend@18339 -
2011-08-20 07:48:33 +00:00
Jonas Maebe
0ee702b3a2 * tprocdef.mangledname now gets an extra boolean parameter indicating
whether the mangled name is for defining a symbol, or for referencing
    it later (e.g. for a call or load of its address). The reason is that
    on the JVM both cases are different.
  + jvmdef unit to encode types according to the JVM rules
  + tprocdef.jvmmangledname() to encode a procdef's JVM mangled name
    (the common part of defining/referencing it; tprocdef.mangledname
     afterwards adorns it as required)

git-svn-id: branches/jvmbackend@18288 -
2011-08-20 07:22:00 +00:00
florian
4f08d148ea * unique internal errors
git-svn-id: trunk@17970 -
2011-07-10 20:54:48 +00:00
florian
26850e3425 * fix full cycle after adding new boolean types
git-svn-id: branches/pasboolxx@17847 -
2011-06-27 20:11:08 +00:00
florian
77f2d6cc0d * introduce usage of TCGInt in the code generator units
git-svn-id: trunk@17459 -
2011-05-14 17:58:23 +00:00
svenbarth
96116a6c3a Several adjustments because virtual methods in helpers are just normal methods and a VMT isn't generated for them either.
* $CPU/cgcpu.pas: disable the generation of VMT loading code
* dbgstabs.pas, dbgdwarf.pas: treat virtual methods of helpers as normal methods
* ncgcal.pas: don't register virtual helper methods for WPO 
* ncgrtti.pas: write virtual helper methods as normal methods to RTTI
* nobj.pas: correctly handle final and override cases in helpers
* pdecvar.pas: property getters
* rautils.pas: no VMT offset in records

git-svn-id: branches/svenbarth/classhelpers@17150 -
2011-03-20 10:41:45 +00:00
Jonas Maebe
a40fe9c078 * fixed potentially wrong operation size in tgppccasenode.genlinearlist()
(was in practice currently probably always correct though)

git-svn-id: trunk@16737 -
2011-01-08 14:20:25 +00:00
paul
b317139006 compiler: fix compilation problems caused by tprocdef._class -> tprocdef.struct rename which was found by make fullcycle
git-svn-id: branches/paul/extended_records@16530 -
2010-12-10 06:50:58 +00:00
Jonas Maebe
f302fcdc98 + TSubRegisterSet definition forgotten to commit in r15952
* fixed compilation on non-x86 platforms after r15952

git-svn-id: trunk@15956 -
2010-09-09 08:48:02 +00:00
Jonas Maebe
356026f849 * use new_section() instead of tai_section.create() everywhere
- sort of reverted r14134, which is no longer required after the above
    change (new_section() inserts the alignment itself)
  * made the tai_section.create() constructor private so it cannot be
    called directly anymore

git-svn-id: trunk@15482 -
2010-06-26 10:50:14 +00:00
Jonas Maebe
283018a3bf * changed tprocdef.funcretloc[] from a tlocation into a tcgpara so it can
represent complex locations (required for full x86-64 ABI support,
    which is not yet implemented) -> lots of special result handling
    code has been removed and replaced by the parameter handling
    routines
  + added support for composite parameters (and hence function
    results) to tcg.a_load_ref_cgpara() (so it can be used for
    handling, e.g., 64 bit parameters on 32 bit platforms)
  * the above fixed writing past the end of allocated memory when
    handling records returned in registers on x86-64 whose size is
    not a multiple of 8 bytes (mantis #16357)
  - removed the x86-64 and PPC specific versions of a_load_ref_cgpara(),
    as they are now handled correctly by the generic version
  * moved the responsibility of allocating tcgpara cpu registers
    (using paramanager.allocparaloc()) from the callers of
    cg.a_load*_cgpara() to the cg.a_load*_cgpara() methods
    themselves (so the register allocation can be done efficiently
    when dealing with function results)
  * for the above, renamed paramanager.alloc/freeparaloc() to
    paramanager.alloc/freecgpara(), and use paramanager.allocparaloc()
    to allocate individual pcgparalocations instead
  * fixed the register size of SSE2 function result registers for
    x86-64 (when used for floating point), which results in removing
    a few superfluous "movs? %xmm0,%xmm0" instructions
  * fixed compilation of paramanagers of avr, m68k and mips after r13695
    and also updated them for these new changes

git-svn-id: trunk@15350 -
2010-05-30 21:12:57 +00:00
Jonas Maebe
9bc15a5f61 * renamed a_param_* to a_load_*_cgpara
git-svn-id: trunk@15305 -
2010-05-22 09:07:21 +00:00
Jonas Maebe
b4c8c73e70 * changed tf_use_function_relative_addresses into an assembler flag (with
the opposite meaning, af_stabs_use_function_absolute_addresses), because it
    is different on Darwin for the internal and external assembler)

git-svn-id: trunk@14342 -
2009-12-06 13:21:28 +00:00
Jonas Maebe
3a774ce66a * fixed alignment for (non-)lazy symbol sections
* converted lazy symbol directive in arm/cgcpu.pas to section, forgotten
    in r14128 (fixes mantis #15047)

git-svn-id: trunk@14135 -
2009-11-10 10:43:15 +00:00
Jonas Maebe
edacea82be * changed assembler directives for darwin lazy/non-lazy symbol pointers
and init/fini routines into their section equivalents (based on patch
    by Dmitry Boyarintsev, mantis #15037)

git-svn-id: trunk@14128 -
2009-11-09 22:20:01 +00:00
Jonas Maebe
0c675a4039 * the objc1 unit has been renamed to objc
* the objc unit links against the Foundation instead of against the Cocoa
    framework, and inludes an interface to either the fragile or non-fragile
    obj-c run time depending on the target platform
  + support for the non-fragile Objective-C runtime/ABI, as used on Mac OS X
    for ARM (iPhone) 64 bit (PowerPC/64, x86_64) -- all these targets now
    are now also supported for the objectivec1 modeswitch
  + support for private_extern symbol bindings, required for the above
  * mark objcclasses that are declared in the implementation section of a
    unit as "hidden" (not sure what the effect is, since the Objective-C
    runtime does not seem to do anything with this flag)
  * enabled all obj-c tests for the newly supported platforms

git-svn-id: branches/objc@13763 -
2009-09-27 15:24:50 +00:00