Commit Graph

261 Commits

Author SHA1 Message Date
mazen
3187986483 + difference between three similar internal errors 2004-03-09 13:04:12 +00:00
florian
fabb9c33ac * top_symbol killed
+ refaddr to treference added
  + refsymbol to treference added
  * top_local stuff moved to an extra record to save memory
  + aint introduced
  * tppufile.get/putint64/aint implemented
2004-02-27 10:21:04 +00:00
peter
a6f79c3c7f * support typecasts for passing @var to formal const 2004-02-26 16:12:04 +00:00
daniel
c57e542a81 * Fixed memory leak 2004-02-22 13:01:15 +00:00
florian
00dbe6655d + nx86set added
* some more x86-64 fixes
2004-02-22 12:04:04 +00:00
florian
e7399ee666 * handling of float parameters passed in mm registers fixed 2004-02-20 22:16:34 +00:00
peter
c844c5a505 * procvar cleanup 2004-02-20 21:55:59 +00:00
peter
7b04fdec2e * fix compilation without GDB 2004-02-11 19:59:06 +00:00
florian
abc41f1c3c * several fixes to parameter handling on arm 2004-02-09 22:48:45 +00:00
peter
1422985ca0 * Change several $ifdef i386 to x86
* Change several OS_32 to OS_INT/OS_ADDR
2004-01-31 17:45:16 +00:00
florian
a1d904c264 * set aktlocaldata for inlined procedures correctly 2004-01-26 17:34:14 +00:00
peter
42c6e9323b * sparc updates, mostly float related 2004-01-12 16:39:40 +00:00
florian
d38abc3a3f + setting of bit 6 of cr for c var args on ppc implemented 2003-12-28 22:09:12 +00:00
florian
ace2d682b0 * rtl and compiler compile with -Cfsse2 2003-12-26 13:19:16 +00:00
florian
b52cee6639 * fixed ppc inlining stuff
* fixed wrong unit writing
  + added some sse stuff
2003-12-21 19:42:42 +00:00
peter
1367e342db * reg allocations for imaginary register are now inserted just
before reg allocation
  * tregister changed to enum to allow compile time check
  * fixed several tregister-tsuperregister errors
2003-12-15 21:25:48 +00:00
Jonas Maebe
eb803d4ad1 * fixed ansistring/widestring results: deallocate result reg only after
it has been stored to memory, as the storing itself may require extra
    results (e.g. on ppc)
2003-12-07 12:41:32 +00:00
florian
bfe452936f * reverted Peter's alloctemp patch; hopefully properly 2003-12-06 01:15:22 +00:00
peter
64b0a0eadf * delayed paraloc allocation, a_param_*() gets extra parameter
if it needs to allocate temp or real paralocation
  * optimized/simplified int-real loading
2003-12-03 23:13:19 +00:00
peter
e3beb78184 * exitlabel for inline procs 2003-12-02 21:23:34 +00:00
peter
f4cffd4358 * removed obsolete nf_cargs flag 2003-11-23 17:39:33 +00:00
peter
51384ca53c * register calling is left-right
* parameter ordering
  * left-right calling inserts result parameter last
2003-11-23 17:05:15 +00:00
peter
f663d2488f * cross unit inlining fixed 2003-11-10 22:02:52 +00:00
florian
bbf7300a0c * Florian's culmutative nr. 1; contains:
- invalid calling conventions for a certain cpu are rejected
    - arm softfloat calling conventions
    - -Sp for cpu dependend code generation
    - several arm fixes
    - remaining code for value open array paras on heap
2003-11-07 15:58:32 +00:00
peter
6b90162c5a * fixes for temp type patch 2003-11-04 19:03:50 +00:00
peter
30f1eb4705 * fix for referencecounted temps 2003-11-04 15:35:13 +00:00
peter
c8300cab51 * fixed rangecheck error 2003-10-30 17:12:49 +00:00
Jonas Maebe
0cac29ec76 + support for fpu temp parameters
+ saving/restoring of fpu register before/after a procedure call
2003-10-29 21:24:14 +00:00
peter
d0b13d33c5 * fixed inlining float parameters for i386 2003-10-20 19:28:17 +00:00
peter
d0de3b3ea8 * 64k registers supported
* fixed some memory leaks
2003-10-17 14:38:32 +00:00
florian
6a01a7b4a6 * compilation of the powerpc compiler fixed 2003-10-17 01:22:08 +00:00
florian
1df13c788c * fixed some MMX<->SSE
* started to fix ppc, needs an overhaul
  + stabs info improve for spilling, not sure if it works correctly/completly
  - MMX_SUPPORT removed from Makefile.fpc
2003-10-11 16:06:42 +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
marco
8f92b2f14e * typo fix from Wiktor 2003-10-10 09:21:53 +00:00
daniel
b2343f4b16 * Register allocator splitted, ans abstract now 2003-10-09 21:31:37 +00:00
peter
e27d6f67da * inline supported again, LOC_REFERENCEs are used to pass the
parameters
  * inlineparasymtable,inlinelocalsymtable removed
  * exitlabel inserting fixed
2003-10-07 15:17:07 +00:00
peter
da9f5e2319 * c style array of const generates callparanodes
* varargs paraloc fixes
2003-10-05 21:21:52 +00:00
peter
3a92a2a25a * parameter alignment fixes 2003-10-03 22:00:33 +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
22158bfb99 * updates for inlining 2003-09-30 21:02:37 +00:00
peter
2581038501 * remove abt reg for vmtreg 2003-09-30 19:55:19 +00:00
peter
540691bf02 * optimized releasing of registers 2003-09-29 20:58:55 +00:00
peter
99bb20747e * parent framepointer changed to hidden parameter
* tloadparentfpnode added
2003-09-28 17:55:03 +00:00
peter
a561878746 * removed a_call_ref 2003-09-28 13:54:43 +00:00
peter
2392f28675 * parameter fixes 2003-09-25 21:28:00 +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
76a53a375d * varspez in calls to push_addr_param 2003-09-16 16:17:01 +00:00
peter
bf0d3c730f * don't use a_call_ref because it can use a parameter register
as temp
2003-09-14 19:17:39 +00:00
florian
8f66389b46 * improved arm code generation
* move some protected and private field around
  * the temp. register for register parameters/arguments are now released
    before the move to the parameter register is done. This improves
    the code in a lot of cases.
2003-09-11 11:54:59 +00:00
marco
cd5ae5fcc3 * Patch from Peter for paraloc 2003-09-10 08:31:47 +00:00
peter
b9d09a4e5c * preparations for different default calling conventions
* various RA fixes
2003-09-07 22:09:34 +00:00
peter
dfd60cb507 * released useparatemp 2003-09-04 15:39:58 +00:00
peter
6a8d5eb25d * NEWRA branch merged 2003-09-03 15:55:00 +00:00
olle
b9394fd616 - removed parameter from fpc_iocheck 2003-08-21 22:14:16 +00:00
Jonas Maebe
4f8c390198 * fixed regvars so they work with newra (at least for ppc)
* fixed some volatile register bugs
  + -dnotranslation option for -dnewra, which causes the registers not to
    be translated from virtual to normal registers. Requires support in
    the assembler writer as well, which is only implemented in aggas/
    agppcgas currently
2003-08-17 16:59:20 +00:00
marco
c461204cdc * fix from Jonas. 2003-08-16 18:56:40 +00:00
peter
52c73e80d1 * start of sparc support for newra 2003-08-11 21:18:20 +00:00
mazen
f8be2992fd - dupplicated code removed 2003-08-11 14:22:06 +00:00
Jonas Maebe
355f84758e * several rg.allocexplicitregistersint/rg.deallocexplicitregistersint
pairs round calls to helpers
2003-07-23 11:01:14 +00:00
Jonas Maebe
d191387d5a * fixed 64bit int results with -dnewra (you can't free both registers and
then allocate two new ones, because then the registers could be reversed
    afterwards -> you get something like "movl %eax, %edx; movl %edx,%eax")
2003-07-21 13:51:50 +00:00
peter
1b633246b9 * sparc fixes 2003-07-08 21:23:24 +00:00
Jonas Maebe
f909d6a620 * fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
so that it doesn't include ebp and esp anymore
2003-07-06 21:50:33 +00:00
peter
32d076480b * framepointer fixes for sparc
* parent framepointer code more generic
2003-07-06 17:58:22 +00:00
daniel
268bfcf784 * Fixed register allocator. *Lots* of fixes. 2003-07-06 15:31:20 +00:00
Jonas Maebe
14bd8b899a * create_paraloc_info() is now called separately for the caller and
callee info
   * fixed ppc cycle
2003-07-05 20:21:26 +00:00
peter
b7d99ec934 * paraloc splitted in callerparaloc,calleeparaloc
* sparc calling convention updates
2003-07-02 22:18:04 +00:00
Jonas Maebe
404d344d92 * lots of newra fixes (need getfuncretparaloc implementation for i386)!
* renamed all_intregisters to volatile_intregisters and made it
    processor dependent
2003-06-17 16:34:44 +00:00
Jonas Maebe
673d792cc6 * release function result registers if the functino result isn't used
* don't allocate function result register with -dnewra if there is none
  * some optimizations for non-x86 processor (don't save any registers
    before a call)
2003-06-15 16:52:02 +00:00
peter
0dceec9a64 * current_procdef removed, use current_procinfo.procdef instead 2003-06-13 21:19:30 +00:00
peter
02b3ec4f28 * newra fixes 2003-06-12 21:10:50 +00:00
Jonas Maebe
5a5b7e0192 * deallocate parameter registers in time for newra
* for non-i386, procvars and methodpointers always have to be processed
    in advance, whether or not newra is defined
2003-06-12 18:38:45 +00:00
Jonas Maebe
55509b199b * (de)allocation of registers for parameters is now performed properly
(and checked on the ppc)
  - removed obsolete allocation of all parameter registers at the start
    of a procedure (and deallocation at the end)
2003-06-09 14:54:26 +00:00
peter
77d641fa2a * init/final of procedure data splitted from genentrycode
* use asmnode getposition to insert final at the correct position
    als for the implicit try...finally
2003-06-09 12:23:29 +00:00
Jonas Maebe
10eb92c546 * optimized assignments with on the right side a function that returns
an ansi- or widestring
2003-06-08 20:01:53 +00:00
Jonas Maebe
992be99250 * fixed weird error in the copyleft statement :) 2003-06-08 18:21:47 +00:00
Jonas Maebe
edb2179730 + added freeintparaloc
* ppc get/freeintparaloc now check whether the parameter regs are
    properly allocated/deallocated (and get an extra list para)
  * ppc a_call_* now internalerrors if pi_do_call is not yet set
  * fixed lot of missing pi_do_call's
2003-06-07 18:57:04 +00:00
Jonas Maebe
29f6a3f50e * fixed double secondpassing of procvar loads 2003-06-04 06:43:36 +00:00
peter
d91c880148 * cg.a_load_* get a from and to size specifier
* makeregsize only accepts newregister
  * i386 uses generic tcgnotnode,tcgunaryminus
2003-06-03 21:11:09 +00:00
daniel
5c6da84d2c * Restored original methodpointer code for non newra case 2003-06-03 20:27:02 +00:00
daniel
41e0bc4cec * Register allocator finished 2003-06-03 13:01:59 +00:00
peter
230a14ff68 * getregisterfpu size parameter added
* op_const_reg size parameter added
  * sparc updates
2003-06-01 21:38:06 +00:00
peter
1e7ecac976 * FUNCTION_RESULT64_LOW/HIGH_REG added for int64 results 2003-05-31 15:05:28 +00:00
peter
92430d4881 * typo in FUNCTION_RESULT_REG 2003-05-31 00:59:44 +00:00
peter
414bd5fa22 * more sparc cleanup
* accumulator removed, splitted in function_return_reg (called) and
    function_result_reg (caller)
2003-05-30 23:57:08 +00:00
Jonas Maebe
bb3a5166db * free callparatemps created for call-by-reference parameters 2003-05-29 10:05:40 +00:00
Jonas Maebe
ead9de924c * added missing initialization of rg.usedint{in,by}proc
* ppc now also saves/restores used fpu registers
  * ncgcal doesn't add used registers to usedby/inproc anymore, except for
    i386
2003-05-28 23:58:18 +00:00
peter
047a066711 * procinlinenode removed
* aktexit2label removed, fast exit removed
  + tcallnode.inlined_pass_2 added
2003-05-26 21:17:17 +00:00
peter
072a55b73e * methodpointer self pushing fixed 2003-05-25 11:34:17 +00:00
peter
b1369666c4 * inline fixes 2003-05-25 08:59:16 +00:00
Jonas Maebe
ff12c6c54f * save fpu results in a normal fpu register on non-x86 processors 2003-05-24 13:36:54 +00:00
Jonas Maebe
ae88588462 - undid previous commit, it was wrong 2003-05-23 19:35:50 +00:00
Jonas Maebe
bee07d21a9 * fixed tests for whether a certain int register is unused 2003-05-23 19:11:58 +00:00
Jonas Maebe
e65fb85ce9 * fixed ppc compiler 2003-05-23 18:01:56 +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
abca40f041 * regvar fixes 2003-05-16 14:33:31 +00:00
peter
92ee1804b6 * removed selfpointer_offset, vmtpointer_offset
* tvarsym.adjusted_address
  * address in localsymtable is now in the real direction
  * removed some obsolete globals
2003-05-15 18:58:53 +00:00
Jonas Maebe
3a35aefdfd * patch from Peter for int64 function results 2003-05-14 19:36:54 +00:00
peter
05c05f2555 * failn removed
* inherited result code check moven to pexpr
2003-05-13 19:14:41 +00:00
peter
5e40220d67 * generate code for procvar first before pushing parameters. Made
the already existing code for powerpc available for all platforms
2003-05-13 15:18:18 +00:00
Jonas Maebe
02496a9934 * moved fpc_check_object call earlier for the ppc, so it can't destroy
already-loaded parameter registers
2003-05-12 18:17:55 +00:00
Jonas Maebe
3aeff19a60 * fixed procvar bug on the ppc (load procvar before loading para's,
because the procvar may otherwise destroy the already loaded paras)
2003-05-11 21:48:38 +00:00
peter
1a2eedd767 * self moved to hidden parameter
* removed hdisposen,hnewn,selfn
2003-05-09 17:47:02 +00:00
peter
e2cbae0ff1 * vs_hidden replaced by is_hidden boolean 2003-05-05 14:53:16 +00:00
florian
91bbc7bea3 * error when address of an abstract method is taken
* fixed some x86-64 problems
  * merged some more x86-64 and i386 code
2003-04-30 20:53:32 +00:00
michael
cf68b27bb9 + Patch from peter to fix wrong pushing of ansistring function results in open array 2003-04-29 07:28:52 +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
7f14891d66 * aktprocdef cleanup, aktprocdef is now always nil when parsing
a new procdef declaration
  * aktprocsym removed
  * lexlevel removed, use symtable.symtablelevel instead
  * implicit init/final code uses the normal genentry/genexit
  * funcret state checking updated for new funcret handling
2003-04-27 07:29:50 +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
daniel
6aa01a99a9 * Ifdefs around a lot of calls to cleartempgen
* Fixed registers that are allocated but not freed in several nodes
  * Tweak to register allocator to cause less spills
  * 8-bit registers now interfere with esi,edi and ebp
    Compiler can now compile rtl successfully when using new register
    allocator
2003-04-25 08:25:26 +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
peter
9ed2ce8c12 * removed some notes/hints 2003-04-22 14:33:38 +00:00
peter
e248c0ece4 * fixed C style array of const
* fixed C array passing
  * fixed left to right with high parameters
2003-04-22 13:47:08 +00:00
daniel
25059e21b6 + Implemented the actual register allocator
+ Scratch registers unavailable when new register allocator used
  + maybe_save/maybe_restore unavailable when new register allocator used
2003-04-22 10:09:34 +00:00
peter
ed82f9ff35 * do not load self when calling a non-inherited class constructor 2003-04-22 09:49:44 +00:00
peter
ab7f62f3e1 * forgot to copy vmtrefaddr to selfrefaddr when self=vmt 2003-04-21 20:03:32 +00:00
Jonas Maebe
e206a74439 - removed copying of all paras when secondpassing a callnode (this used
to be necessary for inlinign support, but currently the whole inlined
    procedure is already copied in advance). Note that the compiler crashes
    when compiling ucomplex with -dTEST_INLINE (also after fixing the
    syntax errors), but that was also the case before this change.
2003-04-21 13:53:16 +00:00
peter
8da3f59d32 * vs_hidden released 2003-04-10 17:57:52 +00:00
olle
a069aadad0 * changed newasmsymbol to newasmsymboldata for data symbols 2003-04-06 21:11:23 +00:00
peter
6a16389f67 * moved generic code from n386cal to ncgcal, i386 now also
uses the generic ncgcal
2003-04-04 15:38:56 +00:00
peter
c4ddcc78a8 * generic constructor working for i386
* remove fixed self register
  * esi added as address register for i386
2003-03-28 19:16:56 +00:00
daniel
436e47a87d * Fixed internalerror 7843 issue 2003-03-06 11:35:50 +00:00
daniel
86bcea6ef5 * Code generator converted to new register notation
- Horribily outdated todo.txt removed
2003-02-19 22:00:14 +00:00
carl
2c19def917 * bugfix of FPU emulation code 2003-02-15 22:17:38 +00:00
carl
ce2b1f45ef * load_frame_pointer is now generic
* change fpu emulation routine names
2003-02-12 22:10:07 +00:00
peter
25d973ef16 * self fixes for static methods (merged) 2003-01-30 21:46:57 +00:00
mazen
07a21319b9 * making math code in RTL compiling.
*NB : This does NOT mean necessary that it will generate correct code!
2003-01-22 20:45:15 +00:00
daniel
b917897ef4 * Optalign conditional code adapted to record Tregister 2003-01-17 12:03:45 +00:00
daniel
55a161bbbf * Tregister changed into a record 2003-01-08 18:43:56 +00:00
florian
c7ca2ff901 + some stuff for the new hidden parameter handling added 2002-12-15 22:50:00 +00:00
florian
1da30f2610 * tcallnode.paraitem introduced, all references to defcoll removed 2002-12-15 21:30:12 +00:00
peter
1b116848d8 * cdecl array of const fixes 2002-11-27 20:04:38 +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
a496dbe1ff * pass proccalloption to ret_in_xxx and push_xxx functions 2002-11-18 17:31:54 +00:00
florian
ee5a01e81a * generic location for float results 2002-11-16 15:34:30 +00:00
peter
bfd72ad5d5 * merged changes from 1.0.7 up to 04-11
- -V option for generating bug report tracing
    - more tracing for option parsing
    - errors for cdecl and high()
    - win32 import stabs
    - win32 records<=8 are returned in eax:edx (turned off by default)
    - heaptrc update
    - more info for temp management in .s file with EXTDEBUG
2002-11-15 01:58:45 +00:00
carl
67486c96c3 * fixes for Delphi 6 compilation
(warning : Some features do not work under Delphi)
2002-10-05 12:43:23 +00:00
florian
d5f0cbbf2b * fixes to common code to get the alpha compiler compiled applied 2002-09-30 07:00:44 +00:00
Jonas Maebe
a15d8cfe39 * a_load_reg_reg() now has two size parameters: source and dest. This
allows some optimizations on architectures that don't encode the
    register size in the register name.
2002-09-17 18:54:01 +00:00
peter
dcd9e0107c * old logs removed and tabs fixed 2002-09-07 15:25:00 +00:00
Jonas Maebe
edb02a1409 * fixed small regalloction info bug 2002-09-07 11:50:02 +00:00
florian
b5e2c87b87 * fixed generic procedure variable calling 2002-09-02 11:25:20 +00:00
florian
6502638258 * several powerpc related stuff fixed 2002-09-01 21:04:47 +00:00
peter
5ab0e99252 * include accumulator in regs_to_push list 2002-09-01 18:43:27 +00:00
peter
a06f84daf8 * use a_call_reg
* ungetiftemp for procvar of object temp
2002-09-01 12:13:00 +00:00
peter
a28f75ed03 * sym.insert_in_data removed
* symtable.insertvardata/insertconstdata added
  * removed insert_in_data call from symtable.insert, it needs to be
    called separatly. This allows to deref the address calculation
  * procedures now calculate the parast addresses after the procedure
    directives are parsed. This fixes the cdecl parast problem
  * push_addr_param has an extra argument that specifies if cdecl is used
    or not
2002-08-25 19:25:18 +00:00
peter
4b81e16fe2 * tempgen cleanup
* tt_noreuse temp type added that will be used in genentrycode
2002-08-23 16:14:48 +00:00
peter
ecb430a8eb * don't write (stabs)line info when inlining a procedure 2002-08-20 16:55:38 +00:00
peter
91b49914f6 * More fixes for cross unit inlining, all tnodes are now implemented
* Moved pocall_internconst to po_internconst because it is not a
    calling type at all and it conflicted when inlining of these small
    functions was requested
2002-08-19 19:36:42 +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