Commit Graph

109 Commits

Author SHA1 Message Date
Jonas Maebe
a64897ddee + thlcgobj.a_loadfpu/mm_loc_ref()
git-svn-id: branches/hlcgllvm@28372 -
2014-08-10 19:40:19 +00:00
Jonas Maebe
4f2b77bc96 + support floating point reference -> integer parameter transfer in
thlcgobj.a_loadfpu_ref_cgpara()

git-svn-id: branches/hlcgllvm@28358 -
2014-08-10 13:19:37 +00:00
Jonas Maebe
8e3062b1b6 * fixed the type specified to reference_reset_base() in
thlcgobj.paravarsym_set_initialloc_to_paraloc(): it has to be the type of
    pointer in the base register, not the type of the variable (and since this
    is a parameter on the stack, use voidstackpointertype rather than
    getpointerdef() for i8086 compatibility)

git-svn-id: branches/hlcgllvm@28351 -
2014-08-10 13:18:34 +00:00
Jonas Maebe
2dfbee45b1 * generate the callerside para/return location info in g_call_system_proc,
so that platform-specific versions of g_call_system_proc_intern() don't
    have to take care of this (since these methods call random routines from
    the system unit, this info may not yet be available)

git-svn-id: branches/hlcgllvm@28203 -
2014-07-12 22:14:02 +00:00
Jonas Maebe
650fd162ea * fixed missing bracket in comment
git-svn-id: branches/hlcgllvm@28153 -
2014-07-04 19:24:17 +00:00
Jonas Maebe
1516661249 + new chlcgobj class reference variable that can be used to call thlcg*
virtual methods even when hlcg doesn't contain a valid instance

git-svn-id: branches/hlcgllvm@28143 -
2014-07-03 22:28:31 +00:00
Jonas Maebe
bf617cb389 * changed hlcgobj.def2reg() into a class method so it can also be called
when there's no instantiated tlhcg

git-svn-id: branches/hlcgllvm@28115 -
2014-07-01 16:30:30 +00:00
Jonas Maebe
0082d3e008 * use hlcgobj methods in maybe_change_load_node_reg
git-svn-id: branches/hlcgllvm@28107 -
2014-07-01 16:30:05 +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
9758a53fa6 - rm the ifdef cpu16bitalu and cpu64bitalu from thlcgobj.a_load_ref_cgpara,
because they:
  - worsen readability (especially if we add cpu8bitalu as well, for
    completeness)
  - are not needed, because the else clause of the previous if ensures that we
    have (sizeleft<=sizeof(aint)) and sizeof(aint) follows the target cpu alu
    size

git-svn-id: trunk@27664 -
2014-04-26 13:46:36 +00:00
sergei
1ec5026465 * Call fpc_shortstr_to_shortstr instead of fpc_shortstr_assign. It is the same procedure with different order of parameters (suited for generation from node level). Now fpc_shortstr_assign remains needed only for bootstrapping.
git-svn-id: trunk@27618 -
2014-04-20 19:27:05 +00:00
svenbarth
5c1b8fdad9 Fix for Mantis #19697. For this we need to have the internal static var symbol know that it came from a static field var symbol so that we can check that for generic or not.
symsym.pas, tfieldvarsym:
  + add new field fieldvarsym which holds a reference to a tfieldvarsym if the static sym was created based on such a symbol
  + add necessary methods and code to correctly load from and store to PPU
  + add new constructor create_from_fieldvar
symcreat.pas, make_field_static: 
  * use new create_from_fieldvar constructor instead of the default one
hlcgobj.pas, finalize_static_data:
  * check whether the static var is based on a generic's class var
ppu.pas:
  * increase PPU version

+ added test

git-svn-id: trunk@27466 -
2014-04-04 16:15:41 +00:00
nickysn
26b53607f8 + added method reference_reset_base with support for different pointer types to
the high level code generator. All hlcg code, except for the jvm code
  generator, updated to use the new method. I didn't update jvm (it still uses
  the method from cgutils), because I'm not familiar with that platform, so I
  might get the types wrong.

git-svn-id: trunk@27309 -
2014-03-28 00:01:18 +00:00
florian
303e8c609d * internalerror unified
git-svn-id: trunk@27222 -
2014-03-21 16:31:17 +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
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
d3c11ca8b3 + support for MMREGISTER -> FPUREGISTER transfers in hlcgobj
git-svn-id: branches/hlcgllvm@27018 -
2014-03-06 21:42:31 +00:00
Jonas Maebe
f36848c243 * separate virtual method for loading the function result para (needed by
llvm)

git-svn-id: branches/hlcgllvm@27011 -
2014-03-06 21:42:07 +00:00
Jonas Maebe
81427523ab * pass a list of (pointers to) the paralocs to hlcgobj.a_call/g_call*, as
required for the LLVM support (LLVM parameter support is not yet
    included)
  * always return the function return loc from a_call*, again as required
    for the LLVM support

git-svn-id: branches/hlcgllvm@26992 -
2014-03-06 21:40:57 +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
florian
150363c09e * thlcgobj.a_load_regconst_subsetreg_intern takes care if the whole register is modified
git-svn-id: trunk@26799 -
2014-02-16 15:13:43 +00:00
sergei
ed1555b918 * Moved generation of .ent/.end directives out of generic code generator.
* Generation of .ent/.end directives for Alpha is dropped, but that target has more important issues to solve.

git-svn-id: trunk@26757 -
2014-02-12 17:30:48 +00:00
yury
56b3287e29 + Added compiler support for mipsel-android target.
git-svn-id: trunk@26686 -
2014-02-06 17:02:43 +00:00
sergei
9c1f917e3a * a_call_ref functionality cannot be implemented efficiently at code generator level, because references need specific preparations at earlier points. Moved this support to tcgcallnode and its x86 descendants, and got rid of all ifdef's around.
+ x86 targets now directly call procedure variables located in references.
- a_call_ref method removed from tcg and thlcgobj.

git-svn-id: trunk@26666 -
2014-02-03 13:28: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
d14ce7817f * factored out setlocalloc and the code to set the initial paravarsym
location from ncgutil into hlcgobj, and override/implement it for llvm
    (use the symbolic parameter names)

git-svn-id: branches/hlcgllvm@26052 -
2013-11-11 11:16:16 +00:00
Jonas Maebe
1df3039424 + LLVM temp allocator based on new R_TEMPREGISTER register class. For every
temp we allocate, we set the base register to a newly allocated
    R_TEMPREGISTER. This allows for uniquely identifying a temp even if its
    offset is modified.

git-svn-id: branches/hlcgllvm@26033 -
2013-11-11 11:14:59 +00:00
Jonas Maebe
9e6764e443 * converted program termination to compilerproc/hlcg
git-svn-id: branches/hlcgllvm@26029 -
2013-11-11 11:14:43 +00:00
Jonas Maebe
cd92791d09 * converted unit initialization to compilerproc/hlcg
git-svn-id: branches/hlcgllvm@26028 -
2013-11-11 11:14:38 +00:00
Jonas Maebe
8d1fb0ee1c * added a safety check to gen_load_cgpara_loc()
git-svn-id: trunk@26024 -
2013-11-10 23:27:05 +00:00
Jonas Maebe
7b97752d0b - removed commented out duplicate thlcg.getmmregister()
git-svn-id: trunk@25887 -
2013-10-31 12:30:53 +00:00
florian
d4968e054b + arm: tsettings.instructionset
* the selected instruction set is now independent from the cpu type: e.g. armv7-a can perfectly execute thumb(2) code

git-svn-id: trunk@25370 -
2013-08-25 21:56:12 +00:00
sergei
bfcdf6b825 * Replaced tai_ent and tai_ent_end classes with tai_directive subtypes. Having separate classes for them is unnecessary complication.
git-svn-id: trunk@25338 -
2013-08-23 12:38:49 +00:00
Jonas Maebe
109317e460 + full support for parameter passing in the high level code generator
(equivalent to what exists in tcgobj)
   o unfortunately it can't be generally enabled for all existing targets
     by overriding/disabling the tcgobj equivalents, because several targets
     call these methods inside other tcgcpu methods and we can't call the high
     level code generator methods from the low level code generator (so right
     now there's quite a bit of code duplication)

git-svn-id: trunk@24763 -
2013-06-02 10:24:13 +00:00
Jonas Maebe
7d9f98e516 + def_cgmmsize() that returns a vector tcgsize for arraydefs (as generated
for certain parameter locations in the x86-64 parameter manager)
  * full support for vector types in the high level code generator by
    translating arraydefs passed to a_*mm*() methods into vector tcgsizes

git-svn-id: trunk@24762 -
2013-06-02 10:24:08 +00:00
Jonas Maebe
4e210e57c2 * use the correct type (pointer to object type) when loading the function
result of a TP-style object constructor

git-svn-id: trunk@24758 -
2013-06-02 10:23:40 +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
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
florian
d4c7afbfe8 + generate thumb_func directives for thumb as well
git-svn-id: trunk@24377 -
2013-04-29 18:23:01 +00:00
nickysn
57777945a8 * fixed bug in thlcgobj.g_array_rtti_helper introduced in the previous commit
git-svn-id: branches/i8086@24284 -
2013-04-21 13:34:49 +00:00
nickysn
a5c5b05362 * initial support for system procs that use calling conventions that push left to right on i8086 or i386
git-svn-id: branches/i8086@24282 -
2013-04-21 13:26:12 +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
paul
51825b6f2e compiler: change ret_in_param to accept tabstractprocdef instead of tproccalloption to allow check more options (required for record constructor implementation)
git-svn-id: trunk@23394 -
2013-01-16 01:14:23 +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
1a8128fa72 * initialize ovloc.loc in a_op*checkoverflow
git-svn-id: trunk@22804 -
2012-10-21 17:56:07 +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
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
288d1ec74a * support referencing "result" in nostackframe pure assembler routines if
the result location is a simple location (a single register/reference)
    (mantis #22490)
  * print an error when accessing "result" in a nostack pure assembler routine
    if the result location is not simple

git-svn-id: trunk@22166 -
2012-08-21 19:51:40 +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