Commit Graph

302 Commits

Author SHA1 Message Date
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
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Jonas Maebe
290e3f5ff8 * fixed assigning one float loc_reference to another of a different size if a
platform does not support (hl)cg.a_loadfpu_*, but only (hl)cg.a_loadmm_*

git-svn-id: trunk@29820 -
2015-02-23 22:47:47 +00:00
Jonas Maebe
ac02c92a0d * disable cg64/cg128 special cases for high level targets
git-svn-id: branches/hlcgllvm@28365 -
2014-08-10 19:40:00 +00:00
Jonas Maebe
7949bebb8d * synchronised with r28168 of trunk
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
svenbarth
441e6c6083 Fix for Mantis #26177. Use the correct value for the method data when using a method pointer of a type or record helper.
Please note that Delphi has the exact same bug as we have and thus code working in FPC will not work in Delphi.
Additionally taking the method address of a local variable or a local/global constant for a method pointer is dangerous as the variable (in case of constants is a temporary local variable) will go out of scope once the containing procedure/function/method exits!

ncgld.pas, tcgloadnode.pass_generate_code:
  * only use the value of Self if it is an implicit pointer object (class instance) or a class reference, but not for everything else (objects, records, primitive types)

+added test

git-svn-id: trunk@28160 -
2014-07-05 08:54:10 +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
nickysn
24bf272c69 * fixed the passing of array of const parameters in i8086 far data memory models
git-svn-id: trunk@27700 -
2014-05-01 12:46:29 +00:00
nickysn
40a6a9c820 + added i8086 specific implementation of thlcgcpu.a_load_loc_ref, which handles
6-byte method pointers and other i8086 types that use loc.registerhi
* changed the i8086 specific code in tcgassignmentnode.pass_generate_code to
  use hlcg.a_load_loc_ref

git-svn-id: trunk@27555 -
2014-04-13 01:38:43 +00:00
nickysn
02988023b7 * tcgloadnode.pass_generate_code: fixes for i8086 far data model fixes in the
handling of method procsyms + even more ifdef i8086s removed

git-svn-id: trunk@27551 -
2014-04-12 19:59:04 +00:00
nickysn
68ff3fb1e2 * tcgloadnode.pass_generate_code: rm the ifdef'd i8086 code from the handling of
non-method procsyms by using def_cgsize(pd.address_type) to determine the
  address size

git-svn-id: trunk@27550 -
2014-04-12 16:26:51 +00:00
nickysn
9ae26316e8 * fixed the handling of const resourcestrings in the i8086 far data memory models
git-svn-id: trunk@27380 -
2014-03-30 16:30:51 +00:00
Jonas Maebe
4a79481c51 * isolated segment-related functionality of tabsolutevarsym into i386/i8086-
specific descendent classes and moved the code that deals with this in the
    code generator also to target-specific classes -> only ifdefs left in
    pdecvar

git-svn-id: trunk@27379 -
2014-03-30 15:42:53 +00:00
nickysn
0082db46ea * i8086 far data memory model fix in tcgloadnode.generate_nested_access.
The system unit now compiles in the compact and large memory models again.

git-svn-id: trunk@27341 -
2014-03-29 18:32:01 +00:00
nickysn
d43d7e59b5 * partially converted the threadvar handling in tcgloadnode.pass_generate_code
to use the hlcg in order to support the i8086 far data memory models. Only the
  instructions that handle the case when there's no thread manager installed
  (FPC_THREADVAR_RELOCATE=nil) are converted, since that's what's used on the
  msdos target. The rest still uses the low level code generator.

git-svn-id: trunk@27336 -
2014-03-29 16:22:48 +00:00
nickysn
7f014c5040 * replaced ifdef i8086 with hlcg.reference_reset_base in tcgloadnode.pass_generate_code
git-svn-id: trunk@27327 -
2014-03-28 23:38:57 +00:00
nickysn
897802c7c4 + fill the treference segment correctly in the load node for localvarsyms and
paravarsyms that are passed by reference in a i8086 far data memory model

git-svn-id: trunk@27277 -
2014-03-25 00:50:18 +00:00
Jonas Maebe
73a3f5ced4 * moved ncgutil.maybechangeloadnodereg() to hlcg.maybe_change_load_node_reg()
and moved ifdef'd jvm code to overridden method

git-svn-id: trunk@27153 -
2014-03-16 11:24:40 +00:00
Jonas Maebe
d8e228e82d - removed unnecessary JVM-specific code
git-svn-id: trunk@27151 -
2014-03-16 11:24:32 +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
nickysn
9eb4419ba3 * fixed the conversion and assignment to the 64-bit boolean types on the i8086
git-svn-id: trunk@26343 -
2013-12-31 17:18:20 +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
967354bb4c * corrected def used for loads of the address of pass-by-reference
parameters

git-svn-id: branches/hlcgllvm@26034 -
2013-11-11 11:15:05 +00:00
nickysn
b8de1370a0 * fixed assignment of i8086 method pointers, when the source is in a register
git-svn-id: trunk@25999 -
2013-11-09 16:50:56 +00:00
nickysn
7ff97d9b7d * specify AT_DATA when refering to the 'RESSTR' symbols; among other things,
this fixes resourcestring constants in the i8086 memory model.

git-svn-id: trunk@25796 -
2013-10-15 22:06:16 +00:00
nickysn
f2763b98fa + implemented absolute seg:ofs vars on i8086
git-svn-id: trunk@25666 -
2013-10-05 22:16:33 +00:00
florian
0a22199738 * always use the varrec size retrieved from the system unit when advancing to the next element
git-svn-id: trunk@25244 -
2013-08-11 20:13:57 +00:00
nickysn
91d7b2bc94 + added i8086 medium/compact model 6-byte (mixed near + far) method pointer support in tcgloadnode and tcgassignmentnode
git-svn-id: trunk@25149 -
2013-07-20 15:06:14 +00:00
florian
541d67771b * keep managed types in registers if possible. Under certain circumstances (if they don't require init/final code,
e.g. being a const parameter or immutable temp. values), managed types like dyn. arrays, new string types and interfaces can be kept in registers.

git-svn-id: trunk@24953 -
2013-06-23 15:16:30 +00:00
nickysn
57e84dc0b4 * set the proper size for far procsyms in tcgloadnode.pass_generate_code
git-svn-id: trunk@24858 -
2013-06-10 01:06:02 +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
5051453806 + support for LOC_(C)MMREGISTER in hlcg
o migrated location_force_mmregister_scalar from ncgutil to hlcgobj

git-svn-id: trunk@24661 -
2013-05-31 12:05:14 +00:00
nickysn
35939ff0a9 + method pointer support for targets with a 16-bit address space in tcgloadnode.pass_generate_code
git-svn-id: trunk@24641 -
2013-05-30 13:22:59 +00:00
nickysn
c41d93214f * fixed passing a longint to an array of const parameter on i8086 (and other 8/16-bit cpus)
git-svn-id: trunk@24588 -
2013-05-25 10:14:39 +00:00
Jonas Maebe
5152c86932 * set the location size of load nodes of procsyms without methodpointer/
framepointer
  * fixed conversion of procedure of object/nested procedure into a procvar
    that only contains the code address

git-svn-id: trunk@23928 -
2013-03-19 12:27:57 +00:00
yury
0960ee2034 * Add missing checks for android target.
git-svn-id: branches/targetandroid@23477 -
2013-01-21 12:08:25 +00:00
sergei
bc4c1149c3 + Native threadvar implementation for Win32 and Win64 (most of it, but not yet complete).
git-svn-id: trunk@23359 -
2013-01-10 19:13:02 +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
761fcca4ec + is_dynamicstring
+ implement low/high for dynamic strings, resolves #15244 and #22936
+ basic support for $zerobasedstrings directive

git-svn-id: trunk@22933 -
2012-11-04 21:48:53 +00:00
florian
ca5fabda6d * cleanup some unused units from uses clauses
git-svn-id: trunk@22433 -
2012-09-21 18:53:46 +00:00
florian
67744ef46e * fix methodpointers in registers on big endian targets
git-svn-id: trunk@22362 -
2012-09-09 17:54:35 +00:00
florian
d93cee995b * fix register method pointer for ppc64 and x86_64-linux
git-svn-id: trunk@22351 -
2012-09-07 15:15:10 +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
370d42035a * when creating method pointers, put them into registers
git-svn-id: trunk@22341 -
2012-09-06 15:11:58 +00:00
florian
d8161c185c + track usage of flags by using a new register RS_/NR_DEFAULTFLAGS
git-svn-id: trunk@22179 -
2012-08-22 19:37:51 +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
78bb3e323a * fixed source type information for values loaded in arrayconstructor after
r21069

git-svn-id: trunk@21350 -
2012-05-20 20:34:14 +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
41d86f2b26 * fixed (harmless) class cast error when checking whether an aggregate
has the same size as one of its members to determine whether we can
    exchange two temps rather than copying one to the other

git-svn-id: trunk@21259 -
2012-05-08 20:02:04 +00:00
sergei
78c0215447 Preparations to native threadvar support:
- i386/cgcpu.pas: removed segment check, rejecting references with segment here is too early. These references are passed to tcgx86.a_loadaddr_ref_reg, which can generate required code for them (or reject if they are not allowed for the target).
- ncgld.pas: removed "not tf_section_threadvars in target_info" condition, it is inverse to one on the following line, making non-generic branch impossible to execute.
+ Define FPC_SECTION_THREADVARS macro if corresponding flag is set for the target.

git-svn-id: trunk@21210 -
2012-05-03 16:26:44 +00:00