Commit Graph

148 Commits

Author SHA1 Message Date
florian
7cd67ea3f0 * node optimizer branch merged
* gotonode and gotolabel refactored
  * -Nu added to enable for loop unrolling

git-svn-id: trunk@446 -
2005-06-19 17:42:10 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
florian
252fa84c62 + compiler support for reading/writing of vararrays 2005-03-27 20:19:21 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
peter
be1808953c * fix laststatement() 2005-01-31 16:15:17 +00:00
peter
5ee4b9ad24 * use tlocation for tempnodes 2004-12-03 16:04:47 +00:00
Jonas Maebe
21c7a9db2f * fixed check for regvar-ability of tempnodes 2004-11-28 19:16:53 +00:00
peter
89b1b583c9 * ttempcreatenode.create_reg merged into .create with parameter
whether a register is allowed
  * funcret_paraloc renamed to funcretloc
2004-11-21 17:54:59 +00:00
peter
c95a859f0a * generic tlocation
* move tlocation to cgutils
2004-10-31 21:45:02 +00:00
peter
560a790a57 * gen high tree makes copy in temp when there is a calln 2004-10-12 14:36:38 +00:00
peter
8fb3536f6e * simple regvar support, not yet finished 2004-09-26 17:45:29 +00:00
Jonas Maebe
ddf175f171 + temps can now also hold fpu values in registers (take care with use,
bacause of the x86 fpu stack)
  * fpu parameters to node-inlined procedures can now also be put in
    a register
2004-07-16 19:45:15 +00:00
florian
8a9758c5e2 * logs truncated 2004-06-20 08:55:28 +00:00
florian
588e2c38bf * dwarf branch merged 2004-06-16 20:07:06 +00:00
peter
b86f2c6a25 * methodpointer is loaded into a temp when it was a calln 2004-05-23 18:28:40 +00:00
peter
72365ec95b * implicit_finally flag must be set in pass1
* add check whether the implicit frame is generated when expected
2004-05-23 15:06:20 +00:00
peter
8756d4f862 * maybe_in_reg moved to tempinfo
* fixed expectloc for maybe_in_reg
2004-03-10 20:41:17 +00:00
Jonas Maebe
5290787578 * don't put types that need init/fini in register temps 2004-02-06 20:22:58 +00:00
peter
ecfbbeffc3 * renamed xNNbittype to xNNinttype
* renamed registers32 to registersint
  * replace some s32bit,u32bit with torddef([su]inttype).def.typ
2004-02-03 22:32:53 +00:00
Jonas Maebe
0d004c1e35 * fixed and re-enabled temps in registers 2004-02-03 19:48:06 +00:00
Jonas Maebe
edb91b0d18 * disabled temps in registers for now, because the register allocator
can't handle it yet in some cases
2004-02-03 17:56:14 +00:00
Jonas Maebe
694eee6cae + support to store ttempcreate/ref/deletenodes in registers
* put temps for withnodes and some newnodes in registers
   Note: this currently only works because calling ungetregister()
     multiple times for the same register doesn't matter. We need again
     a way to specify that a register is currently a regvar and as such
     should not be freed when you call ungetregister() on it.
2004-02-03 16:46:51 +00:00
daniel
97e87aaebc * reginfo now also only allocated during register allocation
* third round of gdb cleanups: kick out most of concatstabto
2004-01-26 16:12:27 +00:00
Jonas Maebe
8da316cf21 * override tblocknode.destroy so all statements are freed sequentially
instead of recusively.
2003-12-10 20:31:40 +00:00
peter
f663d2488f * cross unit inlining fixed 2003-11-10 22:02:52 +00:00
peter
30f1eb4705 * fix for referencecounted temps 2003-11-04 15:35:13 +00:00
peter
f2264589fc * fix crashes in asmnode.deref when p_asm=nil 2003-10-31 15:51:47 +00:00
peter
fae3eaf83d * move check for unused object constructor result to blocknode 2003-10-29 20:34:20 +00:00
peter
4a1ecb07d1 * splitted buildderef and buildderefimpl to fix interface crc
calculation
2003-10-23 14:44:07 +00:00
peter
6878c55c80 * write derefdata in a separate ppu entry 2003-10-22 20:39:59 +00:00
peter
925046ad5f * fixed check for $X- result usage 2003-10-21 18:15:16 +00:00
florian
05fcae577a * some ppc stuff fixed
* memory leak fixed
2003-10-19 01:34:30 +00:00
peter
d0de3b3ea8 * 64k registers supported
* fixed some memory leaks
2003-10-17 14:38:32 +00:00
peter
fb81b7ebbb * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
* tregisteralloctor renamed to trgobj
  * removed rgobj from a lot of units
  * moved location_* and reference_* to cgobj
  * first things for mmx register allocation
2003-10-10 17:48:13 +00:00
peter
70fe77ca7c * procinfo unit contains tprocinfo
* cginfo renamed to cgbase
  * moved cgmessage to verbose
  * fixed ppc and sparc compiles
2003-10-01 20:34:48 +00:00
peter
8af51ea6d3 * locals and paras are allocated in the code generation
* tvarsym.localloc contains the location of para/local when
    generating code for the current procedure
2003-09-23 17:56:05 +00:00
peter
b9d09a4e5c * preparations for different default calling conventions
* various RA fixes
2003-09-07 22:09:34 +00:00
peter
6a8d5eb25d * NEWRA branch merged 2003-09-03 15:55:00 +00:00
daniel
42c320cb29 * cs_regalloc renamed to cs_regvars to avoid confusion with register
allocator
  * Some preventive changes to i386 spillinh code
2003-08-09 18:56:54 +00:00
peter
0dceec9a64 * current_procdef removed, use current_procinfo.procdef instead 2003-06-13 21:19:30 +00:00
Jonas Maebe
1929498b42 * patch from Peter to fix tempinfo copying 2003-06-10 09:10:47 +00:00
peter
ab1f33f68b * remove temptype, use tempinfo.temptype instead 2003-06-09 18:26:46 +00:00
peter
47b691057b * getposition added to retrieve the the current tai item 2003-06-09 12:20:47 +00:00
Jonas Maebe
8e09d78f79 + ability to change the location of a ttempref node with changelocation()
method. Useful to use instead of copying the contents from one temp to
    another
  + some shortstring optimizations in tassignmentnode that avoid some
    copying (required some shortstring optimizations to be moved from
    resulttype to firstpass, because they work on callnodes and string
    addnodes are only changed to callnodes in the firstpass)
  * allow setting/changing the funcretnode of callnodes after the
    resulttypepass has been done, funcretnode is now a property
  (all of the above should have a quite big effect on callparatemp)
2003-06-08 18:27:15 +00:00
Jonas Maebe
820302b098 - disabled "result := value; exit;" -> exit(value) optimization because
a) it was wrong
    b) exit(value) works now exactly the same as that
   (it was only activated with -Or)
2003-05-30 21:01:44 +00:00
peter
8ff5792776 * remove some unit dependencies
* current_procinfo changes to store more info
2003-05-23 14:27:35 +00:00
Jonas Maebe
cb279b2029 * changed tt_persistant to tt_persistent :)
* tempcreatenode now doesn't accept a boolean anymore for persistent
    temps, but a ttemptype, so you can also create ansistring temps etc
2003-05-17 13:30:08 +00:00
peter
05c05f2555 * failn removed
* inherited result code check moven to pexpr
2003-05-13 19:14:41 +00:00
peter
15b0132f6f * tloadnode does not support objectsymtable,withsymtable anymore
* withnode cleanup
  * direct with rewritten to use temprefnode
2003-05-11 14:45:12 +00:00
peter
60978ba89c * aktprocdef renamed to current_procdef
* procinfo renamed to current_procinfo
  * procinfo will now be stored in current_module so it can be
    cleaned up properly
  * gen_main_procsym changed to create_main_proc and release_main_proc
    to also generate a tprocinfo structure
  * fixed unit implicit initfinal
2003-04-27 11:21:32 +00:00
peter
f4b818fc1d * removed funcretn,funcretsym, function result is now in varsym
and aliases for result and function name are added using absolutesym
  * vs_hidden parameter for funcret passed in parameter
  * vs_hidden fixes
  * writenode changed to printnode and released from extdebug
  * -vp option added to generate a tree.log with the nodetree
  * nicer printnode for statements, callnode
2003-04-25 20:59:33 +00:00
Jonas Maebe
5ed5d2897f * fixed ttemprefnode.compare and .getcopy to take offset field into
account
2003-04-23 08:41:34 +00:00
peter
47489f2376 * firstpass uses expectloc
* checks if there are differences between the expectloc and
    location.loc from secondpass in EXTDEBUG
2003-04-22 23:50:22 +00:00
Jonas Maebe
934974e234 * fixed tstatementnode.det_resulttype and tststatementnode.pass_1
* fixed some getcopy issues with ttemp*nodes
2003-04-21 15:00:22 +00:00
daniel
a32926e2fc * Some work on interference graph construction 2003-04-17 07:50:24 +00:00
Jonas Maebe
bd90c192c5 * ttempdeletenode.create now sets the nodetype to tempdeleten instead of
temprefn
2003-04-12 14:53:59 +00:00
peter
e25ef86b0a * errornode.mark_write added 2003-03-17 20:30:46 +00:00
daniel
5041b70618 * Removed ifdefs around notifications
ifdefs around for loop optimizations remain
2003-01-03 12:15:55 +00:00
peter
34e8266af4 * case statement inlining added
* fixed inlining of write()
  * switched statementnode left and right parts so the statements are
    processed in the correct order when getcopy is used. This is
    required for tempnodes
2002-11-27 02:37:12 +00:00
peter
f3fc72095f * splitted defbase in defutil,symutil,defcmp
* merged isconvertable and is_equal into compare_defs(_ext)
  * made operator search faster by walking the list only once
2002-11-25 17:43:16 +00:00
peter
d8495ac883 * don't complain in X- mode for internal generated function calls
with funcretrefnode set
  * give statement error at the correct line position instead of the
    block begin
2002-10-05 15:15:19 +00:00
daniel
4b82d30953 * Removed sets from Tcallnode.det_resulttype
+ Added read/write notifications of variables. These will be usefull
   for providing information for several optimizations. For example
   the value of the loop variable of a for loop does matter is the
   variable is read after the for loop, but if it's no longer used
   or written, it doesn't matter and this can be used to optimize
   the loop code generation.
2002-09-01 08:01:16 +00:00
peter
98dd65b0f3 * inlining is now also allowed in interface
* renamed write/load to ppuwrite/ppuload
  * tnode storing in ppu
  * nld,ncon,nbas are already updated for storing in ppu
2002-08-18 20:06:23 +00:00
florian
4144773f01 * result type handling in tcgcal.pass_2 overhauled
* better tnode.dowrite
  * some ppc stuff fixed
2002-08-17 22:09:43 +00:00
florian
e313bab4ff * first part of procinfo rewrite 2002-08-17 09:23:33 +00:00
peter
8082f79ea6 * first things tai,tnode storing in ppu 2002-08-15 19:10:35 +00:00
florian
59abf2555b * types.pas renamed to defbase.pas because D6 contains a types
unit so this would conflicts if D6 programms are compiled
  + Willamette/SSE2 instructions to assembler added
2002-07-20 11:57:52 +00:00
daniel
399036f1c2 * State tracker work
* The whilen and repeatn are now completely unified into whilerepeatn. This
  allows the state tracker to change while nodes automatically into
  repeat nodes.
* Resulttypepass improvements to the notn. 'not not a' is optimized away and
  'not(a>b)' is optimized into 'a<=b'.
* Resulttypepass improvements to the whilerepeatn. 'while not a' is optimized
  by removing the notn and later switchting the true and falselabels. The
  same is done with 'repeat until not a'.
2002-07-19 11:41:34 +00:00
daniel
eeae0e4c00 + Added the beginning of a state tracker. This will track the values of
variables through procedures and optimize things away.
2002-07-14 18:00:43 +00:00
peter
4285e99853 * internal linker
* reorganized aasm layer
2002-07-01 18:46:20 +00:00
Jonas Maebe
09de3f8d5b * fixed errors found with new -CR code from Peter when cycling with -O2p3r 2002-06-24 12:43:00 +00:00
peter
06ebac4e27 * readded missing revisions 2002-05-18 13:34:04 +00:00
carl
21b3a10f02 + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+ try to fix temp allocation (still in ifdef)
+ generic constructor calls
+ start of tassembler / tmodulebase class cleanup
2002-05-16 19:46:34 +00:00
peter
2992e1819c * removed old logs and updated copyright year 2002-05-14 19:34:38 +00:00
florian
6bbaa14daf * block nodes within expressions shouldn't release the used registers,
fixed using a flag till the new rg is ready
2002-04-25 20:15:39 +00:00
peter
67ede1276b * add pinline unit that inserts compiler supported functions using
one or more statements
  * moved finalize and setlength from ninl to pinline
2002-04-23 19:16:34 +00:00
peter
6320530bdd * removed newn and disposen nodes, the code is now directly
inlined from pexpr
  * -an option that will write the secondpass nodes to the .s file, this
    requires EXTDEBUG define to actually write the info
  * fixed various internal errors and crashes due recent code changes
2002-04-21 19:02:03 +00:00
peter
5e7a1e3729 * removed unused units
* use tlocation.size in cg.a_*loc*() routines
2002-04-04 19:05:54 +00:00
Jonas Maebe
7fb55bf4e4 + a_loadfpu_* and a_loadmm_* methods in tcg
* register allocation is now handled by a class and is mostly processor
    independent (+rgobj.pas and i386/rgcpu.pas)
  * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  * some small improvements and fixes to the optimizer
  * some register allocation fixes
  * some fpuvaroffset fixes in the unary minus node
  * push/popusedregisters is now called rg.save/restoreusedregisters and
    (for i386) uses temps instead of push/pop's when using -Op3 (that code is
    also better optimizable)
  * fixed and optimized register saving/restoring for new/dispose nodes
  * LOC_FPU locations now also require their "register" field to be set to
    R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  - list field removed of the tnode class because it's not used currently
    and can cause hard-to-find bugs
2002-03-31 20:26:33 +00:00
peter
d2e1952377 * procsym definition rewrite 2001-11-02 22:58:00 +00:00
peter
43dea5a35f * move class of definitions into type section for delphi 2001-09-02 21:12:06 +00:00
florian
9746f4c2d6 * some cg reorganisation
* some PPC updates
2001-08-26 13:35:06 +00:00
Jonas Maebe
fc1b58c22c * moved "reverseparameters" from ninl.pas to ncal.pas
+ support for non-persistent temps in ttempcreatenode.create, for use
    with typeconversion nodes
2001-08-24 13:47:26 +00:00
Jonas Maebe
a6cfe4083a + tempcreate/ref/delete nodes (allows the use of temps in the
resulttype and first pass)
  * made handling of read(ln)/write(ln) processor independent
  * moved processor independent handling for str and reset/rewrite-typed
    from firstpass to resulttype pass
  * changed names of helpers in text.inc to be generic for use as
    compilerprocs + added "iocheck" directive for most of them
  * reading of ordinals is done by procedures instead of functions
    because otherwise FPC_IOCHECK overwrote the result before it could
    be stored elsewhere (range checking still works)
  * compilerprocs can now be used in the system unit before they are
    implemented
  * added note to errore.msg that booleans can't be read using read/readln
2001-08-23 14:28:35 +00:00
peter
81200dc9ef * funcret moved from tprocinfo to tprocdef 2001-08-06 21:40:46 +00:00
Jonas Maebe
f855dff46d * fixed web bug #1501 in conjunction with -Or 2001-06-11 17:41:12 +00:00
peter
767062cb3b * tasmnode.pass_2 is independent of cpu, moved to ncgbas
* include ncgbas for independent nodes
2001-05-18 22:31:06 +00:00
peter
a7cf57524e * symtable change to classes
* range check generation and errors fixed, make cycle DEBUG=1 works
  * memory leaks fixed
2001-04-13 01:22:06 +00:00
peter
4e2655cdc5 * resulttype rewrite 2001-04-02 21:20:29 +00:00
peter
2531d36bff * fixed buf 1364 2001-02-05 20:45:49 +00:00
Jonas Maebe
4c8ca9774f + implemented/fixed docompare() mathods for all nodes (not tested)
+ nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
    and constant strings/chars together
  * n386add.pas: don't copy temp strings (of size 256) to another temp string
    when adding
2000-12-31 11:14:10 +00:00
peter
32b9cdb7cf + new tlinkedlist class (merge of old tstringqueue,tcontainer and
tlinkedlist objects)
2000-12-25 00:07:25 +00:00
florian
b9796f6a7f * unused units removed from uses clause
* some changes for widestrings
2000-11-29 00:30:30 +00:00
peter
451723647e * symtable splitted, no real code changes 2000-10-31 22:02:46 +00:00
Jonas Maebe
c3025eb50b + implementation for tasmnode.getcopy 2000-10-27 14:57:16 +00:00
peter
4b17f6f0ff * fixed memory leaks 2000-10-14 21:52:54 +00:00
peter
e171f341a0 * moehrendorf oct 2000 rewrite 2000-10-14 10:14:45 +00:00