Commit Graph

278 Commits

Author SHA1 Message Date
peter
65c3ba277c * ungetregister is now only used for cpuregisters, renamed to
ungetcpuregister
  * renamed (get|unget)explicitregister(s) to ..cpuregister
  * removed location-release/reference_release
2004-09-25 14:23:54 +00:00
peter
33a834821f * paraloc branch merged 2004-09-21 17:25:12 +00:00
Jonas Maebe
8e0fd21568 * fixed op_const_reg_reg for (OP_ADD,0,reg1,reg2) 2004-07-17 14:48:20 +00:00
Jonas Maebe
fab51678da * fixed passing of fpu paras on the stack
* fixed number of fpu parameters passed in registers
  * skip corresponding integer registers when using an fpu register for a
    parameter under the AIX abi
2004-07-09 21:45:24 +00:00
Jonas Maebe
d30ced66a1 * fixed several errors due to aword -> aint change 2004-07-01 18:00:00 +00:00
florian
8a9758c5e2 * logs truncated 2004-06-20 08:55:28 +00:00
peter
54cb433625 * powerpc compiles again 2004-06-17 16:55:46 +00:00
Jonas Maebe
42f59a3ca9 * parameters passed on the stack now also work as register variables 2004-06-02 17:18:10 +00:00
Jonas Maebe
174cea8023 * changed calling of external procedures to be the same as under gcc
(don't worry about all the generated stubs, they're optimized away
     by the linker)
    -> side effect: no need anymore to use special declarations for
       external C functions under Darwin compared to other platforms
       (it's still necessary for variables though)
2004-05-31 18:08:41 +00:00
olle
6be3ad0f87 * macos: fixed large offsets in references 2004-04-04 17:50:36 +00:00
florian
8cdd1af070 * fixed ppc compilation 2004-03-06 21:37:45 +00:00
florian
5b32162bde * got entry code fixed 2004-03-02 17:48:32 +00:00
florian
61f15e4ec4 * make cycle fixed
+ pic support for darwin
  + support of importing vars from shared libs on darwin implemented
2004-03-02 17:32:12 +00:00
olle
4fecc1a56f * big transformation of Tai_[const_]Symbol.Create[data]name* 2004-03-02 00:36:32 +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
florian
302d2d1442 * compilation fixed 2004-02-09 22:45:49 +00:00
olle
d173a77b9f * macos: a_load_store fixed to only allocat temp reg if needed, side effect is compiler work for macos again. 2004-02-09 20:44:40 +00:00
Jonas Maebe
9495f77117 - removed taicpu.is_reg_move because it's not used anymore
+ support tracking fpu register moves by rgobj for the ppc
2004-02-08 20:15:42 +00:00
Jonas Maebe
a23c7932cf * fixed previous commit 2004-02-08 14:50:13 +00:00
Jonas Maebe
169c8f5a3b * changed an explicit mr to a_load_reg_reg so it's registered with the
register allocator as move
2004-02-07 15:01:05 +00:00
peter
8c5b0f7d82 * first try to get cpupara working for x86_64 2004-02-04 22:01:13 +00:00
Jonas Maebe
5a98f00e7f - removed mov "reg, reg" optimizations, as they are removed by the
register allocator and may be necessary to indicate a register may not
    be reused before some point
2004-02-03 19:49:24 +00:00
Jonas Maebe
c006ab8326 - removed double construction of fpu register allocator 2004-01-25 16:36:34 +00:00
peter
47f08937e4 * use localalign info for alignment for locals and temps
* sparc fpu flags branching added
  * moved powerpc copy_valye_openarray to generic
2004-01-12 22:11:38 +00:00
Jonas Maebe
92f038ebec * fixed saving/restoring of volatile fpu registers under sysv
+ better provisions for abi differences regarding fpu registers that have
    to be saved
2003-12-29 14:17:50 +00:00
Jonas Maebe
83323b4955 * fixed tb0350 (support loading address of reference containing the
address 0)
2003-12-29 11:13:53 +00:00
Jonas Maebe
8953ed5494 * fixed tnotnode for < 32 bit quantities 2003-12-28 23:49:30 +00:00
florian
218beb5b32 * handling of open array value parameters fixed 2003-12-28 19:22:27 +00:00
peter
1c7e6fc380 * sparc updates
* use registertype in spill_register
2003-12-26 14:02:30 +00:00
florian
7bd24b32c3 + register allocators are set to nil now after they are freed 2003-12-18 01:03:52 +00:00
florian
2aeea741ed * fixed ppc compilation 2003-12-16 21:49:47 +00:00
Jonas Maebe
03d03d7ce4 * fixed compilation and simplified fixref, so it never has to reallocate
already freed registers anymore
2003-12-15 21:37:09 +00:00
peter
bce5a1e252 * rg[tregistertype] added in tcg 2003-12-12 17:16:17 +00:00
Károly Balogh
c5afdadecb * fixed compilation with -dppc603 2003-12-10 00:09:57 +00:00
Jonas Maebe
8c11916462 * forgot call to cg.g_overflowcheck() in nppcadd
* fixed overflow flag definition
  * fixed cg.g_overflowcheck() for signed numbers (jump over call to
    FPC_OVERFLOW if *no* overflow instead of if overflow :)
2003-12-09 20:39:43 +00:00
florian
e63ae3ffee * a_load_ref_ref isn't allowed to be used in g_stackframe_entry 2003-12-07 21:59:21 +00:00
Jonas Maebe
30cf6be249 * another fix to a_load_ref_reg()
+ implemented uses_registers() method
2003-12-06 22:13:53 +00:00
Jonas Maebe
8cb716ca56 * fixed load_ref_reg for source > dest size 2003-12-05 22:53:28 +00:00
Jonas Maebe
255589e12e * fixed some int<->boolean type conversion issues 2003-12-04 20:37:02 +00:00
Jonas Maebe
4ac4d2cadb * fixded fixref() regarding the reallocation of already freed registers
used in references
2003-11-30 11:32:12 +00:00
Jonas Maebe
08a966d88a * fixed fpu regallocator initialisation 2003-11-30 10:16:05 +00:00
florian
256299c274 * fixed reading of reg. sets in the arm assembler reader 2003-11-21 16:29:26 +00:00
florian
f72431af31 + copying of open array value parameters to the heap implemented 2003-11-02 17:19:33 +00:00
Jonas Maebe
a624d954f4 * fixed releasing of references (ppc also has a base and an index, not
just a base)
2003-11-02 15:20:06 +00:00
florian
05fcae577a * some ppc stuff fixed
* memory leak fixed
2003-10-19 01:34:30 +00:00
florian
5b33ab3643 * fixed more ppc stuff 2003-10-17 15:25:18 +00:00
peter
0939085ab1 * commented out more obsolete constants 2003-10-17 15:08:34 +00:00
peter
ec2e200e42 * fixed ppc build 2003-10-17 14:52:07 +00:00
florian
6a01a7b4a6 * compilation of the powerpc compiler fixed 2003-10-17 01:22:08 +00:00
florian
c70c620d9b * some ideas for mm support implemented 2003-10-13 01:58:03 +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
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
Jonas Maebe
c8863b920b * fixed some ppc problems 2003-09-14 16:37:20 +00:00
peter
98d153815c * some fixes for ppc 2003-09-03 21:04:14 +00:00
peter
601160a0e3 * powerpc compiles again 2003-09-03 19:35:24 +00:00
peter
6a8d5eb25d * NEWRA branch merged 2003-09-03 15:55:00 +00:00
Jonas Maebe
11e98e7d73 * some newra optimizations (eliminate lots of moves between registers) 2003-08-18 21:27:00 +00:00
olle
c6f4df63e6 + cleaning up in proc entry and exit, now calc_stack_frame always is used. 2003-08-18 11:50:55 +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
peter
52c73e80d1 * start of sparc support for newra 2003-08-11 21:18:20 +00:00
olle
c2fe8dbd99 * merged macos entry/exit code generation into the general one. 2003-08-08 15:49:24 +00:00
Jonas Maebe
a3cb0d2002 * don't use rg.getregisterint() anymore in g_stackframe_entry_*, because
the register colouring has already occurred then, use a hard-coded
    register instead
2003-07-23 11:02:23 +00:00
Jonas Maebe
d73acd12f6 * fixed newra bug due to the fact that we sometimes need a temp reg
when loading/storing to memory (base+index+offset is not possible)
    and because a reference is often freed before it is last used, this
    temp register was soemtimes the same as one of the reference regs
2003-07-20 20:39:20 +00:00
Jonas Maebe
af61f830d0 * fixed bug in g_concatcopy with -dnewra 2003-07-20 16:15:58 +00:00
Jonas Maebe
1846337739 * fixed ppc compiler 2003-07-06 20:25:03 +00:00
Jonas Maebe
70a5d1e4c2 * create_paraloc_info() is now called separately for the caller and
callee info
  * fixed ppc cycle
2003-07-05 20:11:41 +00:00
peter
b7d99ec934 * paraloc splitted in callerparaloc,calleeparaloc
* sparc calling convention updates
2003-07-02 22:18:04 +00:00
olle
280c8655e5 * macos: fixes of loading-code 2003-06-18 10:12:36 +00:00
Jonas Maebe
642d0f923b * ppc compiles with -dnewra, haven't tried to compile anything with it
yet though
2003-06-14 22:32:43 +00:00
peter
0dceec9a64 * current_procdef removed, use current_procinfo.procdef instead 2003-06-13 21:19:30 +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
Jonas Maebe
d32d1a711e - removed duplicate identifier 2003-06-08 18:19:27 +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
eb066d3b32 * calculate localsize also in g_return_from_proc since it's now called
before g_stackframe_entry (still have to fix macos)
  * compilation fixes (cycle doesn't work yet though)
2003-06-04 11:58:58 +00:00
peter
230a14ff68 * getregisterfpu size parameter added
* op_const_reg size parameter added
  * sparc updates
2003-06-01 21:38:06 +00:00
Jonas Maebe
abc1c5bf2f * fix for bug in fixref that Peter found during the Sparc conversion 2003-06-01 13:42:18 +00:00
Jonas Maebe
fefdcc6331 * fixed bug with intregvars
* locapara.loc can also be LOC_CFPUREGISTER -> also fixed
    rcgppc.a_param_ref, which previously got bogus size values
2003-05-30 18:52:10 +00:00
Jonas Maebe
c70f75f1b7 * compile with -dppc603 to not use unaligned float loads in move() and
g_concatcopy, because the 603 and 604 take an exception for those
    (and netbsd doesn't even handle those in the kernel). There are
    still some of those left that could cause problems though (e.g.
    in the set helpers)
2003-05-29 21:17:27 +00:00
Jonas Maebe
05a3d71c88 * also free temps in g_concatcopy if delsource is true 2003-05-29 10:06:09 +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
florian
a8eb2ab740 * started to fix and clean up the sparc port 2003-05-28 23:18:31 +00:00
Jonas Maebe
54cacc63a5 * fixed integer typeconversion problems 2003-05-24 11:59:42 +00:00
Jonas Maebe
74301b9544 * fixed support for nested procedures and more parameters than those
which fit in registers (untested/probably not working: calling a
    nested procedure from a deeper nested procedure)
2003-05-23 18:51:26 +00:00
florian
9de6468186 + basic darwin support added 2003-05-20 23:54:00 +00:00
florian
137395876d * fixed last commit, changing lastsaveintreg to r31 caused some strange problems 2003-05-15 22:14:42 +00:00
florian
5f6578729b * sysv entry code saves r13 now as well 2003-05-15 21:37:00 +00:00
florian
9c507c2da0 * fixed ppc compiler which was broken by Peter's changes 2003-05-15 19:39:09 +00:00
Jonas Maebe
0a392ebf5e * fixed g_concatcopy 2003-05-12 18:43:50 +00:00
Jonas Maebe
7d5a2715f6 * fixed bug with large offsets in entrycode 2003-05-11 20:59:23 +00:00
Jonas Maebe
b993c4e2db * fixed shifts 2003-05-11 11:45:08 +00:00
Jonas Maebe
2c81208d56 * fixed optimizations in a_op_const_reg_reg() 2003-05-11 11:07:33 +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
Jonas Maebe
38d7ec6670 * fix to a_op64_const_reg_reg 2003-04-26 22:56:11 +00:00
Jonas Maebe
31d94f4f4c * fixed g_flags2reg 2003-04-26 16:08:41 +00:00
florian
dda473894c * fixed cmp_reg_reg_reg, cmp operands were emitted in the wrong order 2003-04-26 15:25:29 +00:00
florian
b9c76fcf5e * stack frame calculations are now completly done using the code generator
routines instead of generating directly assembler so also large stack frames
    are handle properly
2003-04-25 20:55:34 +00:00
florian
7ec9711f9a * fixed several issues with nested procedures 2003-04-24 11:24:00 +00:00
peter
c092e24817 * fixes to get rtl compiled 2003-04-23 22:18:01 +00:00
florian
0284016ee9 * fixed several issues with powerpc
+ applied a patch from Jonas for nested function calls (PowerPC only)
  * ...
2003-04-23 12:35:34 +00:00
Jonas Maebe
56132c1a9c * assembler procedures now again get a stackframe if they have local
variables. No space is reserved for a function result however.
    Also, the register parameters aren't automatically saved on the stack
    anymore in assembler procedures.
2003-04-16 09:26:55 +00:00
Jonas Maebe
f51a189be0 * don't generate entry/exit code for assembler procedures 2003-04-06 16:39:11 +00:00
Jonas Maebe
e02ecef001 * fixed linux entry/exit code generation 2003-03-22 18:01:13 +00:00
Jonas Maebe
5893b9bb19 * fixed R_TOC bugs introduced by new register allocator conversion 2003-03-19 14:26:26 +00:00
olle
87fb801dcb * change in a_loadaddr_ref_reg 2003-03-13 22:57:45 +00:00
Jonas Maebe
24e2741659 * more powerpc and generic fixes related to the new register allocator 2003-03-12 22:43:38 +00:00
Jonas Maebe
d168ae15df * lots of new regallocator fixes, both in generic and ppc-specific code
(ppc compiler still can't compile the linux system unit though)
2003-03-11 21:46:24 +00:00
daniel
86bcea6ef5 * Code generator converted to new register notation
- Horribily outdated todo.txt removed
2003-02-19 22:00:14 +00:00
olle
a02a1adee1 * changed global var access, TOC now contain pointers to globals
* fixed handling of function pointers
2003-01-13 17:17:50 +00:00
florian
2102ce7031 * fixed some PowerPC issues 2003-01-09 22:00:53 +00:00
daniel
55a161bbbf * Tregister changed into a record 2003-01-08 18:43:56 +00:00
florian
938f46f246 * fixed some crashes and a rte 201 2002-12-15 19:22:01 +00:00
olle
5e90be8184 * macos: changing code gen for references to globals 2002-11-28 10:55:16 +00:00
Jonas Maebe
fb5b623e30 * fixed bctr(l) problems 2002-11-07 15:50:23 +00:00
olle
9284b36d3b * macos: globals are located in TOC and relative r2, instead of absolute 2002-11-04 18:24:19 +00:00
olle
b71c1492a9 * macos entry/exit: only used registers are saved
- macos entry/exit: stackptr not saved in r31 anymore
  * macos entry/exit: misc fixes
2002-10-28 22:24:28 +00:00
olle
4d3ed1a22c * macos stack frame size computing updated
+ macos epilogue: control register now restored
  * macos prologue and epilogue: fp reg now saved and restored
2002-10-19 23:51:48 +00:00
olle
7fde7960b5 * reorganized prologue and epilogue routines 2002-10-19 12:50:36 +00:00
florian
fa4a4de18c * all A_BL instructions replaced by calls to a_call_name 2002-10-02 21:49:51 +00:00
Jonas Maebe
a738c4ddcf * changed a_call_* so that no superfluous code is generated anymore 2002-10-02 13:24:58 +00:00
olle
fa695eefea * made a_load_store more robust and to accept large offsets and cleaned up code 2002-10-01 05:24:28 +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
Jonas Maebe
02e9260997 + added some internal errors
* fixed bug in sysv exit code
2002-09-10 21:22:25 +00:00
Jonas Maebe
32d4d8780f * fixed TOpCmp2AsmCond array (some unsigned equivalents were wrong) 2002-09-08 20:11:56 +00:00
Jonas Maebe
07c1116a8c * several large offset-related fixes 2002-09-08 13:03:26 +00:00
florian
a7a354956d * first part of PowerPC fixes 2002-09-07 17:54:58 +00:00
peter
dcd9e0107c * old logs removed and tabs fixed 2002-09-07 15:25:00 +00:00
Jonas Maebe
ce868dcdac + a_call_reg()
* small fix in a_call_ref()
2002-09-02 10:14:51 +00:00
Jonas Maebe
c7df12f6f0 * fixed range error 2002-09-02 06:09:02 +00:00
florian
6502638258 * several powerpc related stuff fixed 2002-09-01 21:04:47 +00:00
peter
7898dcf9ed + a_call_reg, a_call_loc added
* removed exprasmlist references
2002-09-01 12:09:27 +00:00
Jonas Maebe
431b9fac81 * fixed a_call_ref (it should load ctr, not lr) 2002-08-31 21:38:02 +00:00
florian
391ce796ef * fixed several problems caused by Jonas' commit :) 2002-08-31 21:30:45 +00:00
Jonas Maebe
76111bb9eb + implemented a_call_ref() 2002-08-31 19:25:50 +00:00
florian
0d1a344d7f + the ppc gas assembler writer adds now registers aliases
to the assembler file
2002-08-18 22:16:14 +00:00
florian
b841ba8b16 * some assembler writer bugs fixed 2002-08-17 18:23:53 +00:00
florian
e313bab4ff * first part of procinfo rewrite 2002-08-17 09:23:33 +00:00
carl
745efb2c47 * issameref() to test if two references are the same (then emit no opcodes)
+ ret_in_reg to replace ret_in_acc
    (fix some register allocation bugs at the same time)
  + save_std_register now has an extra parameter which is the
    usedinproc registers
2002-08-16 14:24:57 +00:00
carl
c33d99adb7 - a_load_sym_ofs_reg removed
* loadvmt now calls loadaddr_ref_reg instead
2002-08-15 08:13:54 +00:00
peter
425bb45ddc * renamed current_library to objectlibrary 2002-08-11 14:32:25 +00:00
peter
ac71268ce6 * saving of asmsymbols in ppu supported
* asmsymbollist global is removed and moved into a new class
    tasmlibrarydata that will hold the info of a .a file which
    corresponds with a single module. Added librarydata to tmodule
    to keep the library info stored for the module. In the future the
    objectfiles will also be stored to the tasmlibrarydata class
  * all getlabel/newasmsymbol and friends are moved to the new class
2002-08-11 13:24:10 +00:00
Jonas Maebe
9ba736bd04 + powerpc-specific genlinearlist 2002-08-11 11:39:12 +00:00
Jonas Maebe
ee7d5f7b2a * various fixes and optimizations 2002-08-10 17:15:31 +00:00
florian
b136cecacd * first part of ppc calling conventions fix 2002-08-06 20:55:20 +00:00
Jonas Maebe
e7d92a1aa7 * fixed bug in g_flags2reg()
* and yet more constant operation fixes :)
2002-08-06 07:12:05 +00:00
Jonas Maebe
10c4e8eb15 * fixed compilation problems 2002-08-05 08:58:53 +00:00
Jonas Maebe
8ff3e3e1b3 * more misc. fixes, mostly constant-related 2002-08-04 12:57:55 +00:00
Jonas Maebe
54011b5bea * some misc constant fixes 2002-08-02 11:10:42 +00:00
florian
ed950491a8 * the code generator knows now if parameters are in registers 2002-07-30 20:50:43 +00:00
florian
e7a6cd18dd * more fixes for the ppc
+ wrappers for the tcnvnode.first_* stuff introduced
2002-07-29 21:23:42 +00:00
florian
37351a4590 - removed debug code which was commited by accident 2002-07-28 21:38:30 +00:00