Commit Graph

242 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
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Károly Balogh
0021ad714f * fixed some ancient code behind cpu_uses_separate_address_registers define to at least compile again, for some m68k experiment
git-svn-id: trunk@30130 -
2015-03-07 22:11:43 +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
d6de2c03cb * generic part of r26050 from the hlcgllvm branch: made tcgvecnode hlcg-safe
o in particular, add tdef size information to the update_reference*()
     methods, and factored out offset adjustments into its own method
   o also make sure the passed size to update_reference*() corresponds to the
     actual size of the index, as it's no longer guaranteed to be ptruint
     since the previous commit

git-svn-id: trunk@29967 -
2015-02-23 22:56:00 +00:00
Jonas Maebe
67c9d60b72 * factored out the check regarding whether the index of a vecn needs to be
loaded into a register because of its size
   o by default, also allow if the size is the same as OS_ADDR but with a
     different sign

git-svn-id: trunk@29827 -
2015-02-23 22:48:08 +00:00
sergei
d4969ca2ee * Fixed subscripting records of size OS_PAIR on big endian targets and enabled placing such records into registers. Tested and shows no regressions on mips-linux.
git-svn-id: trunk@29493 -
2015-01-17 11:30:19 +00:00
sergei
11201164e7 * Fixed type of parameter passed to FPC_CHECKPOINTER after r23325, must be the pointer itself, not what it points to. Was causing IE 200306031 when compiling for i386 with -gc.
git-svn-id: trunk@28644 -
2014-09-12 18:50:09 +00:00
Jonas Maebe
7949bebb8d * synchronised with r28168 of trunk
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
florian
417d444376 * do not crash with an internal error if an indexed access is done on a constant pointer node
git-svn-id: trunk@27789 -
2014-05-14 17:35:09 +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
de1b8cf5d6 * use def_cgsize(parentfpvoidpointertype) instead of OS_ADDR in
tcgloadparentfpnode.pass_generate_code (should've been part of r27690)

git-svn-id: trunk@27693 -
2014-04-30 17:37:47 +00:00
nickysn
cb33e51425 * tcgloadparentfpnode.pass_generate_code converted to the high level code
generator. This fixes nested access to parentfp in i8086 memory models where
  DS<>SS.

git-svn-id: trunk@27690 -
2014-04-29 23:32:22 +00:00
florian
701cdf8ea2 * fix for #25956: left is not necessarily the array load node when accessing an open array/array of const element
git-svn-id: trunk@27487 -
2014-04-06 15:15:16 +00:00
Jonas Maebe
338c064beb * moved x86-specific tpointerdef functionality to architecture-specific
descendants

git-svn-id: trunk@27397 -
2014-03-30 21:04:36 +00:00
nickysn
75f29aacc3 * i8086 far data memory model fixes in tcgsubscriptnode.pass_generate_code
git-svn-id: trunk@27340 -
2014-03-29 18:30:32 +00:00
nickysn
409b047b59 * i8086 far data memory model fixes for the handling of dynamic (ansi/wide/
unicode) strings and dynarrays in tcgvecnode.pass_generate_code

git-svn-id: trunk@27334 -
2014-03-29 14:39:22 +00:00
nickysn
891ab86254 * fixed ncgutil.gen_load_vmt_register and tcgloadvmtaddrnode.pass_generate_code
for i8086 far data memory models by using the high level code generator

git-svn-id: trunk@27326 -
2014-03-28 23:16:14 +00:00
nickysn
e465ab355b * converted tcgaddrnode.pass_generate_code to use the high level code generator,
which makes the i8086 overridden class unnecessary

git-svn-id: trunk@27323 -
2014-03-28 16:19:49 +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
46e7caef7d * converted tcgaddrnode.pass_generate_code to the high level code generator
git-svn-id: branches/hlcgllvm@27137 -
2014-03-14 18:22:17 +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
nickysn
2908fa9123 + added type parentfpvoidpointertype, which is a void pointer with the same size
as the hidden parentfp parameter, passed to nested procs. On i8086 it is
  always a near pointer, unlike voidpointer (which changes according to the
  memory model). This fixes nested procs in i8086 far data memory models.

git-svn-id: trunk@26934 -
2014-03-02 22:55:52 +00:00
florian
cd6f4d4469 * fix tsubscriptnode to handle left.location being an fpu or mm register as well.
git-svn-id: trunk@26642 -
2014-02-01 13:08:21 +00:00
florian
546f4a5d46 * force records with LOC_CONSTANT into memory when they are subscripted
git-svn-id: trunk@26630 -
2014-01-30 19:44:09 +00:00
florian
1d73f49330 * do not force the index location to a register for vec. nodes if the index is already in a register
git-svn-id: trunk@26629 -
2014-01-30 17:34:35 +00:00
Károly Balogh
5e15e4b07d add basic constant handling to subscript nodes, avoid ie20060521 when building rgobj.pas with -O3/-O4
git-svn-id: trunk@26532 -
2014-01-20 12:00:48 +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
25fab5b0b6 + support for array vecnodes on the llvm target, both for regular and for
bitpacked arrays:
   o separate the element size from the index when constructing the memory
     references, so we can easily use the llvm getelementptr instruction
   o handle conversion of s80real values from their array declaration
     as array elements to floating point values when loading them

git-svn-id: branches/hlcgllvm@26050 -
2013-11-11 11:16:09 +00:00
Jonas Maebe
b47cc22d66 * separated JVM-specific subscripting code in virtual method
git-svn-id: branches/hlcgllvm@26030 -
2013-11-11 11:14:47 +00:00
nickysn
bf07fc077b * specify AT_DATA in all references to the tobjectdef.vmt_mangledname symbol.
This fixes a lot of bugs, related to objects and classes in the i8086 medium
  memory model

git-svn-id: trunk@25794 -
2013-10-15 18:56:27 +00:00
florian
963a488ca2 * handle also LOC_CREGISTER/LOC_CMMREGISTER in tcgvecnode.pass_generate_code, resolves #24705
git-svn-id: trunk@25039 -
2013-07-04 19:36:28 +00:00
florian
6ab95815d8 * try to optimze (p-/+const)^ by putting const into the offset of the generated reference
git-svn-id: trunk@25014 -
2013-06-29 22:20:34 +00:00
florian
be2ab84474 * make actualtargetnode a normal procedure using pointers to node so it can be used also when replacing nodes
+ replacenode to replace nodes inline

git-svn-id: trunk@25013 -
2013-06-29 22:20:30 +00:00
nickysn
b0f7786782 + added support for special versions of near data pointers associated with a x86 segment register. They are supported on all x86 platforms: i8086, i386 and x86_64
git-svn-id: trunk@24453 -
2013-05-05 17:22:37 +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
florian
77bbb8b5bc * type casting could force class variables into sub registers, so handle them in subscript nodes as well
git-svn-id: trunk@23587 -
2013-02-10 10:06:36 +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
c781f21a46 * records with two times the size of a register can be kept in registers
git-svn-id: trunk@23313 -
2013-01-04 21:48:41 +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
sergei
12ad6704f6 - Removed a number of unused variables, reduces noise at compilation.
git-svn-id: trunk@22880 -
2012-10-30 11:55:59 +00:00
florian
b72251389b * when forcing left into memory during code generation of a subscript node then the type of left must be passed else memory corruption happens
git-svn-id: trunk@22385 -
2012-09-13 19:22:42 +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
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
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
452414e1a7 - removed cg.g_indirect_sym_load() calls from pass_generate_code; this
routine is called from tcgppcgen.fixref()/tcgx86.make_simple_ref()
    when necessary

git-svn-id: trunk@20789 -
2012-04-11 18:00:21 +00:00
Jonas Maebe
0d5b2b84a8 + Android/JVM target, including a translation of the Android r14 SDK
(= Android 4.0) java headers: java.*, javax.*, org.*, junit.*, android.*).
    The RTL can also be used to target earlier versions of the Android
    platform, but you manually have to take care of not using APIs that
    weren't available yet. Adding separate units for separate platform
    versions would only partly solve the problem, because some of the
    classes used inside the system unit have also changed across
    versions.

    Use -Tandroid while compiling to select the Android OS as target
    platform.

git-svn-id: branches/jvmbackend@19830 -
2011-12-12 02:34:34 +00:00
paul
4cf5e36ce7 compiler:
- add TTagHashSet class descendant of THashSet with an ability to has also a LongWord value together with key
  - change TAsmData.ConstPools[] to be an indexed property to properly initialize ConstPool class, remove pool initialization from all other units
  - add ansistring constants to pool together with their encoding to distinct the same text constants with different codepage
  + test

git-svn-id: trunk@19261 -
2011-09-28 01:18:43 +00:00
Jonas Maebe
8fa42c206f + support for nested procedures for the JVM target
o since the JVM target has no stack/framepointer that can be passed
     on to nested routines, all local variables and parameters accessed
     from nested routines are grouped into a local record whose address
     is passed to nested routines. The same technique is also required
     for LLVM in the future

git-svn-id: branches/jvmbackend@18588 -
2011-08-20 08:12:59 +00:00