Commit Graph

5339 Commits

Author SHA1 Message Date
daniel
41e0bc4cec * Register allocator finished 2003-06-03 13:01:59 +00:00
florian
b84cead281 * absolutesyms aren't fpuregable either 2003-06-02 22:59:17 +00:00
florian
89cc00f6e4 * classes and interfaces can be stored in integer registers 2003-06-02 22:55:28 +00:00
florian
bfd89a3fd3 * better handling of CREGISTER in subscript nodes 2003-06-02 22:35:45 +00:00
Jonas Maebe
6f3e16298a * function results can now also be regvars
- removed tprocinfo.return_offset, never use it again since it's invalid
    if the result is a regvar
2003-06-02 21:42:05 +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
peter
7b3095fe27 * reference fixes 2003-06-01 01:04:35 +00:00
peter
e03a8f8f69 * FMOVs fixed 2003-06-01 01:03:53 +00:00
peter
0106a4a537 * remove unsupported combinations
* reg_ref_reg only allowed for refs_lo,refs_hi
2003-06-01 01:03:41 +00:00
peter
948ef20ecc * generic a_call_ref 2003-06-01 01:02:39 +00:00
Jonas Maebe
4d70aebb1b * constant evaluation of trunc() and round() now also gives 64 bit
results
2003-05-31 21:29:04 +00:00
Jonas Maebe
a6d430204c * temp fix/hack for nested procedures (disable regvars in all procedures
that have nested procedures)
  * leave register parameters in their own register (instead of storing
    them to memory or assigning them to another register) if the current
    procedure doesn't call any other procedures
2003-05-31 20:33:57 +00:00
Jonas Maebe
f67e370ce1 * set inital costs of assigning a variable to a register to 120 for
non-i386, because the used register must be store to memory at the
    start and loaded again at the end
2003-05-31 20:31:11 +00:00
Jonas Maebe
dbf22a6cc9 * changed copyvalueparas so it also supports register parameters
(except for copy_value_openarray, but that one is seriously broken
     anyway, since it expects that the high parameter will always be in
     memory right after the pointer to the array, while it could just as
     will be in a register)
2003-05-31 20:28:17 +00:00
Jonas Maebe
5a4c00bedd * added pi_do_call if a procedure has a value shortstring parameter
(it's copied to the local stackframe with a helper)
2003-05-31 20:23:39 +00:00
Jonas Maebe
8b60e1e414 * add default system for ppc 2003-05-31 18:14:06 +00:00
marco
ce67daed63 * Fix to not print empty -Fl when gcclib not found 2003-05-31 17:15:40 +00:00
peter
9cafe9c315 * fixed opsize and operand size setting for 64bit values 2003-05-31 16:22:28 +00:00
marco
d2d02b6cc6 * cpuppc -> cpupowerpc. Target compiler was always linux for ppc 2003-05-31 16:17:27 +00:00
peter
1e7ecac976 * FUNCTION_RESULT64_LOW/HIGH_REG added for int64 results 2003-05-31 15:05:28 +00:00
peter
0e11419a26 * load_loc_reg update 2003-05-31 15:04:31 +00:00
peter
790e125329 * register fixes 2003-05-31 01:00:51 +00:00
peter
92430d4881 * typo in FUNCTION_RESULT_REG 2003-05-31 00:59:44 +00:00
Jonas Maebe
2961250600 * fixed my previous commit 2003-05-31 00:48:15 +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
31db518df3 * forgot to commit, a_load_loc_reg change 2003-05-30 23:54:08 +00:00
Jonas Maebe
e7e2cfe9a4 * a_load_loc_reg now has an extra size parameter for the destination
register (properly fixes what I worked around in revision 1.106 of
    ncgutil.pas)
2003-05-30 23:49:18 +00:00
marco
1daf2ca476 * register skipping (aligning) for int64 parameters, sys V abi only. 2003-05-30 23:45:49 +00:00
marco
a73b98ea9f * getfuncretparaloc now uses r3 for highdword and r4 for lo. Doesn't work tho 2003-05-30 22:54:19 +00:00
marco
152b525419 * committed fix that swaps int64 parameters hi and lo. 2003-05-30 22:35:03 +00:00
Jonas Maebe
0c717891ff * fixed bug in a_load_loc_ref (the source instead of dest size was passed
to a_load_reg_ref in case of a register)
2003-05-30 21:40:00 +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
Jonas Maebe
0357f71e14 * fixed several regvar related bugs for non-i386. make cycle with -Or now
works for ppc
2003-05-30 18:55:21 +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
d321606bc5 * changed scratchregs from r28-r30 to r29-r31
* made sure the regvar registers don't overlap with the scratchregs
    anymore
2003-05-30 18:49:59 +00:00
Jonas Maebe
413030a90d * fixed problem where sometimes no register was allocated for the result
of an addnode when using regvars
2003-05-30 18:49:14 +00:00
Jonas Maebe
7d1f5c8330 * fixed intregister bug
* fixed error in my previous commit: vo_(fpu)regable should only be set
    for (inline)localsymtable and (inline)parasymtable entries
2003-05-30 18:48:17 +00:00
Jonas Maebe
6c7f3ad02e * the vartype field of tvarsym is now a property, because is_XXXregable
must be updated when the vartype is changed
2003-05-30 13:35:10 +00:00
Jonas Maebe
f433c21ead * use as little different registers on the ppc until newra is released,
since every used register must be saved
2003-05-30 12:36:13 +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
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
florian
a8eb2ab740 * started to fix and clean up the sparc port 2003-05-28 23:18:31 +00:00
Jonas Maebe
eb441421cc * fixed ppc cycle 2003-05-27 21:19:08 +00:00
Jonas Maebe
2fafd75860 * patch from Peter for nested procedures 2003-05-27 14:28:14 +00:00
mazen
d0249adf22 + RegEnum2Number to ease handling register pairs
* changed convert_register_to_enum to use above
  array
2003-05-26 22:08:42 +00:00
mazen
a6880bcaa4 * added 64 bit value support to fix a problem in RTL 2003-05-26 22:04:57 +00:00
mazen
11f582061e * mnemonic of A_LDF is ld, ldf does not exist! 2003-05-26 21:31:27 +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
75394a788e * disable string node optimizations for the moment 2003-05-26 21:15:18 +00:00
peter
7054a48b4d * removed systems unit 2003-05-26 19:39:51 +00:00
peter
0799b0663d * generic fpc_shorstr_concat
+ fpc_shortstr_append_shortstr optimization
2003-05-26 19:38:28 +00:00
peter
c48956fd16 * don't generate align in .bss 2003-05-26 19:37:57 +00:00
Jonas Maebe
035ad566f9 * endian fix is now done using a define instead of with source_info 2003-05-26 15:49:54 +00:00
marco
925bc00623 * NetBSD target support. OpenBSD reserved in the enum, for future use. 2003-05-25 23:15:04 +00:00
Jonas Maebe
1bb8852335 * fixed register numbering bug 2003-05-25 14:32:42 +00:00
peter
072a55b73e * methodpointer self pushing fixed 2003-05-25 11:34:17 +00:00
peter
aaf6114364 * moved Comment calls to messge file 2003-05-25 10:27:12 +00:00
peter
1b72901b14 * recursive include depth check 2003-05-25 10:26:43 +00:00
peter
c0995a3db1 * fix interrupt stack allocation 2003-05-25 10:26:15 +00:00
Jonas Maebe
9a0c1f50e9 - undid previous patch, it was not necessary and on top of that, it
contained a bug :/
2003-05-25 09:27:13 +00:00
peter
64eb7ee2ec * do not generate code when there was an error 2003-05-25 08:59:47 +00:00
peter
b1369666c4 * inline fixes 2003-05-25 08:59:16 +00:00
peter
cbbbd01d44 * load result using hidden parameter 2003-05-25 08:55:49 +00:00
florian
1f099e81a7 * if something doesn't work with callparatemp, the define callparatemp
should be used because other processors with reigster calling conventions
    depend on this as well
2003-05-24 21:12:57 +00:00
Jonas Maebe
1712878279 * fixed tcginnode endian bug again, but correcty this time :) 2003-05-24 19:48:49 +00:00
Jonas Maebe
4ca3d9a2e9 * fixed shr of 64 bit values by non-immediate value 2003-05-24 19:15:29 +00:00
Jonas Maebe
527153658e * added missing firstpass for callparatemp code 2003-05-24 17:16:37 +00:00
Jonas Maebe
a835c08458 - removed bogus location_copy for include/exclude 2003-05-24 17:15:59 +00:00
Jonas Maebe
df07c64f1f * added missing firstpass for withrefnode 2003-05-24 17:15:24 +00:00
Jonas Maebe
f8c0236bf4 * fixed expectloc of notnode for all processors that have flags 2003-05-24 16:32:34 +00:00
Jonas Maebe
517e16dae7 * fixed endian problem with tlocation.value/valueqword fields 2003-05-24 16:02:01 +00:00
Jonas Maebe
df5e0bbfc6 * fsqrt is an optional instruction in the ppc architecture and isn't
implemented by any current ppc afaik, so use the generic sqrt routine
    instead (adapted so it works with compilerproc)
2003-05-24 13:39:32 +00:00
Jonas Maebe
ee71991a7f * don't save callee-save registers in the caller as well (the ppc code
that we generate is slow enough as it is without resorting to doing
    double work :)
2003-05-24 13:38:04 +00:00
Jonas Maebe
f85bec0291 * endian fixes 2003-05-24 13:37:10 +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
54cacc63a5 * fixed integer typeconversion problems 2003-05-24 11:59:42 +00:00
Jonas Maebe
5cfedffb9e * added some missing paralocation size settings 2003-05-24 11:48:40 +00:00
Jonas Maebe
d321a5aa3d * fixed framepointer storage: it's now always stored at r1+12, which is
a place in the link area reserved for compiler use.
2003-05-24 11:47:27 +00:00
Jonas Maebe
7804ac8ec2 - disable addoptnodes for powerpc, because they can generate calls in
pass_2, so -dcallparatemp can't detect them as nested calls
2003-05-23 22:57:38 +00:00
florian
995f7e0f11 * fix some small flaws which prevent sparc linux system unit from compiling
* some reformatting done
2003-05-23 22:33:48 +00:00
florian
89c93b12c4 * fixed sparc compiler compilation 2003-05-23 21:10:50 +00:00
Jonas Maebe
e8bceeb54a * fixed exclude 2003-05-23 21:10:38 +00:00
Jonas Maebe
25435fe881 * corrected fix for endian differences in tcginnode 2003-05-23 19:52:28 +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
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
Jonas Maebe
ce0885b092 * generate code for parent procedure before that of nested procedures as
well (I only need pass_1 to be done for the ppc, but pass_1 and pass_2
    are grouped and it doesn't hurt that pass_2 is done as well)
2003-05-23 18:49:55 +00:00
Jonas Maebe
e65fb85ce9 * fixed ppc compiler 2003-05-23 18:01:56 +00:00
peter
5b3a91188b * loadn procsym need to return procdef 2003-05-23 17:05:13 +00:00
peter
e13e129c3c * write interface crc to .ppu.intf when enabled
* when a unit is compiled with -Ur check only interface crc
2003-05-23 17:04:37 +00:00
peter
895e03b854 * write header for crc_only 2003-05-23 17:03:51 +00:00
peter
e91cc82200 * better error for undefined ordinal labels 2003-05-23 15:15:36 +00:00
peter
c9ecdb1a24 * fix previous commit for unix 2003-05-23 15:03:31 +00:00
peter
24e4003aa3 * FindFilePChar added to allow PATH variables > 256 chars 2003-05-23 14:39:56 +00:00
peter
8ff5792776 * remove some unit dependencies
* current_procinfo changes to store more info
2003-05-23 14:27:35 +00:00
peter
e6f72d2037 * add cgcpu 2003-05-22 21:39:51 +00:00
peter
5f6de7eb1f * inherite from tcgprocinfo 2003-05-22 21:34:11 +00:00
peter
9e2958f846 * i386 att instruction table moved to separate unit 2003-05-22 21:33:08 +00:00
peter
437ce7f8a2 * removed some unit dependencies 2003-05-22 21:32:28 +00:00
peter
345228fd29 * defer codegeneration for nested procedures 2003-05-22 21:31:35 +00:00
peter
31286d02e6 * search defaulthandler only for message methods 2003-05-22 17:43:21 +00:00
florian
1770c1db0f * fixed sparc compilation partially 2003-05-22 16:11:22 +00:00
florian
9de6468186 + basic darwin support added 2003-05-20 23:54:00 +00:00
florian
999b859bc8 * fixed calling sequence for subroutines using the aix abi 2003-05-19 12:15:28 +00:00
Tomas Hajny
2698227d41 * message correction 2003-05-18 20:07:31 +00:00
florian
b1b16c8f09 + added abi field to tsysteminfo 2003-05-18 15:15:59 +00:00
Jonas Maebe
4aadabdf80 * fixed size setting of result location of innodes 2003-05-17 19:17:35 +00:00
Jonas Maebe
56b4360422 * fixed callparatemp for ansi/widestring and interfacecoms 2003-05-17 14:05:58 +00:00
Jonas Maebe
624819ccb8 * fixed para/localst calculations (note to self: don't commit at
extremely late/early hours :)
2003-05-17 14:05:30 +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
Jonas Maebe
9055529171 * workaround for nested procedures until Peter fixes it properly :) 2003-05-16 23:15:51 +00:00
Jonas Maebe
3973883fe1 - undid previous commit, it wasn't necessary 2003-05-16 20:54:12 +00:00
Jonas Maebe
d816c6a8c6 * powerpc nested procedure fixes, should work completely now if all
local variables of the parent procedure are declared before the
    nested procedures are declared
2003-05-16 20:00:39 +00:00
Jonas Maebe
66792ee44e * adapted for Peter's regvar fixes 2003-05-16 16:26:05 +00:00
peter
abca40f041 * regvar fixes 2003-05-16 14:33:31 +00:00
peter
1d3a842c07 * fix dup check for hiding the result varsym in localst, the result
sym was already in the localst when adding the locals
2003-05-16 14:32:58 +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
peter
8f5b16d364 * remove po_containsself 2003-05-15 21:10:32 +00:00
florian
9c507c2da0 * fixed ppc compiler which was broken by Peter's changes 2003-05-15 19:39:09 +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
florian
a41d686f98 * fixed getintparaloc call for ansi- and widestring range checking 2003-05-15 16:10:37 +00:00
Jonas Maebe
3a35aefdfd * patch from Peter for int64 function results 2003-05-14 19:36:54 +00:00
Jonas Maebe
bfd98ec80d * fixed callparatemp so it works with vs_var, vs_out and formal const
parameters
2003-05-14 19:35:50 +00:00
Jonas Maebe
6ecd566473 * fixed a_param64_reg 2003-05-14 19:31:37 +00:00
peter
1a7f159fad * only call destructor in except block when there is a destructor
available
2003-05-13 21:26:38 +00:00
peter
fcea95f596 * ifdef'd code that checked for failed inherited constructors 2003-05-13 20:54:39 +00:00
peter
b7cbd27c9d * fail checks vmt value before calling dispose 2003-05-13 20:54:06 +00:00
peter
b52ba06662 * constructors return in register 2003-05-13 20:53:41 +00:00
florian
043bb34e81 * fixed temp. management for CPUs were the temp. space grows upwards 2003-05-13 20:13:41 +00:00
peter
9ffa87206f * removed radirect 2003-05-13 19:15:28 +00:00
peter
05c05f2555 * failn removed
* inherited result code check moven to pexpr
2003-05-13 19:14:41 +00:00
peter
a467b84faa * fixed various crashes 2003-05-13 15:18:49 +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
peter
4ba5171726 * fix crash with hiding function result. The function result is now
inserted as last so the symbol that we are going to insert is the
    result and needs to be renamed instead of the already existing
    symbol
2003-05-13 15:17:13 +00:00
peter
c577c78366 * removed ret_in_acc, it's the reverse of ret_in_param
* fixed ret_in_param for win32 cdecl array
2003-05-13 15:16:13 +00:00
peter
ff172b6b2d * fixed import crash with explicit provided name 2003-05-13 15:15:25 +00:00
Jonas Maebe
0836ed1713 * patch from Peter for rtti symbols 2003-05-13 08:13:16 +00:00
peter
2c63c84131 * extdebug info temp alloc type was wrong 2003-05-12 21:29:59 +00:00
florian
d73c88ce9f * fixed parameter passing by value of large sets, strings and method pointers 2003-05-12 20:14:47 +00:00
Jonas Maebe
0a392ebf5e * fixed g_concatcopy 2003-05-12 18:43:50 +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
peter
b42efec29d * create rtti label using newasmsymboldata and update binding
only when calling tai_symbol.create
  * tai_symbol.create_global added
2003-05-12 18:13:57 +00:00
Jonas Maebe
8acf67d327 * fixed (last?) remaining -tvarsym(X).address to
tg.direction*tvarsym(X).address...
2003-05-12 17:22:00 +00:00
Jonas Maebe
f8cb290a84 * fixed several initialization and finalization related bugs (missing
tg.direction's, wrong paralocation for decreasing refcount of
    everything but ansistrings)
2003-05-12 08:08:27 +00:00
florian
65eba18e20 * fixed passing of small const arrays and const records, they are always passed by reference 2003-05-11 23:19:32 +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