Commit Graph

254 Commits

Author SHA1 Message Date
florian
9833f642fe * coalesce if either u or v are precolored, tested on arm and i386, it gives for both a small advantage
git-svn-id: trunk@21812 -
2012-07-07 21:20:26 +00:00
Jonas Maebe
0fc422f244 * moved definition of maxcpuregister and tcpuregisterset from cgbase to
cgutils, and define them so they are no larger than what is required by
    the current target platform
  * added cgutils to the uses clause of several units that use the
    tcpuregisterset type

git-svn-id: trunk@21624 -
2012-06-15 18:24:35 +00:00
Jonas Maebe
6f336a5d13 * the register allocator always knows the exact number of the first imaginary
supreg of the current register type, so use that rather than the maximum of
    all possible register types

git-svn-id: trunk@21623 -
2012-06-15 18:24:30 +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
florian
6211a83865 * write variable locations of 64 bit integer values on 32 bit targets correctly
* when transforming imag. register variable locations into real ones, take care of the register type

git-svn-id: trunk@18958 -
2011-09-03 19:43:50 +00:00
Jonas Maebe
00cb8f5725 * made maxregs related information protected instead of private in trgobj,
as well as insert_regalloc_info_all()
  + "register" allocator for the jvm target, which simply replaces every
    virtual register with a temp. This is done for all register types in
    one pass, so that the temps can be easily reused without worrying
    about conflicts. Small optimisation: alloc/store/dealloc/load
    sequences for a single reg are removed (many of these are generated
    because most cg nodes return their value in a register which is then
    immediately consumed by the parent)
  * map addressregisters to integer registers with size R_SUBD, because
    they require one stackslot (the subregister type is used by rgcpu
    to determine the size of the temp it has to allocate)

git-svn-id: branches/jvmbackend@18316 -
2011-08-20 07:38:11 +00:00
florian
68dd23b5a2 * write proper register locations when doing ssa, resolves #7552
git-svn-id: trunk@18278 -
2011-08-19 22:06:52 +00:00
mazen
b127fc154a * Fixed spell error revealed by lintian.
git-svn-id: trunk@16094 -
2010-10-06 20:33:57 +00:00
Jonas Maebe
22b4860dd7 * getregisterinline() can be used to replace multiple size variants
of the same register (or of a register and its aliases) -> make
    sure that all relevant constraints are applied to it as well
    (mantis #16980)

git-svn-id: trunk@15952 -
2010-09-08 21:13:02 +00:00
Jonas Maebe
b475d03612 * changed backwards_was_first and extended_backwards from supregsets into
tbitsets so that they can grow as necessary and so that we don't have
    to fill the entire 8KiB all the time

git-svn-id: trunk@15604 -
2010-07-18 22:00:55 +00:00
Jonas Maebe
8be466546a * disabled superfluous zeroing of another field
git-svn-id: trunk@15529 -
2010-07-05 21:35:47 +00:00
Jonas Maebe
fb65172a5a * commented out a number of superfluous zero-initialisations of (large)
class instance fields
  * changed a number of for-loop iteration variables from tsuperregister
    (= word) into cardinal

git-svn-id: trunk@15519 -
2010-07-03 13:09:58 +00:00
Jonas Maebe
d1538ab023 o added ARM VPFv2/VFPv3 support:
+ RTL support:
      o VFP exceptions are disabled by default on Darwin,
        because they cause kernel panics on iPhoneOS 2.2.1 at least
      o all denormals are truncated to 0 on Darwin, because disabling
        that also causes kernel panics on iPhoneOS 2.2.1 (probably
        because otherwise denormals can also cause exceptions)
    * set softfloat rounding mode correctly for non-wince/darwin/vfp
      targets
    + compiler support: only half the number of single precision
      registers is available due to limitations of the register
      allocator
    + added a number of comments about why the stackframe on ARM is
      set up the way it is by the compiler
    + added regtype and subregtype info to regsets, because they're
      also used for VFP registers (+ support in assembler reader)
    + various generic support routines for dealing with floating point
      values located in integer registers that have to be transferred to
      mm registers (needed for VFP)
    * renamed use_sse() to use_vectorfpu() and also use it for
      ARM/vfp support
    o only superficially tested for Linux (compiler compiled with -Cpvfpv6
      -Cfvfpv2 works on a Cortex-A8, no testsuite run performed -- at least
      the fpu exception handler still needs to be implemented), Darwin has
      been tested more thoroughly
  + added ARMv6 cpu type and made it default for Darwin/ARM
  + ARMv6+ implementations of atomic operations using ldrex/strex
  * don't use r9 on Darwin/ARM, as it's reserved under certain
    circumstances (don't know yet which ones)
  * changed C-test object files for ARM/Darwin to ARMv6 versions
  * check in assembler reader that regsets are not empty, because
    instructions with a regset operand have undefined behaviour in that
    case
  * fixed resultdef of tarmtypeconvnode.first_int_to_real in case of
    int64->single type conversion
  * fixed constant pool locations in case 64 bit constants are generated,
    and/or when vfp instructions with limited reach are present

  WARNING: when using VFP on an ARMv6 or later cpu, you *must* compile all
    code with -Cparmv6 (or higher), or you will get crashes. The reason is
    that storing/restoring multiple VFP registers must happen using
    different instructions on pre/post-ARMv6.

git-svn-id: trunk@14317 -
2009-12-03 22:46:30 +00:00
Jonas Maebe
93523c7767 * fixed for overflow in sort_movelist (by Paul Ishenin, mantis #15204), and
made a similar change in sort_simplify_worklist

git-svn-id: trunk@14296 -
2009-12-03 11:07:37 +00:00
florian
0c8546f94c * more MIPS code of David Zhang integrated
git-svn-id: trunk@14228 -
2009-11-20 14:46:45 +00:00
Jonas Maebe
718694d1d6 * always specify an explicit alignment for tgobj.gettemp (so e.g.
shortstring temps don't get maximum alignment)
  * changed some gettemptyed() calls into gettemp() calls (gettemptyped
    means that this temp can only be used for temps of that type,
    which is necessary for refcounted types but not for floats)

git-svn-id: trunk@12036 -
2008-11-08 22:20:47 +00:00
yury
0bcaf8845f * Fixed 'mixed signed/unsigned' warnings.
* Suppressed 2 unreachable code warnings.
* Now x86 compiler compiles without warnings and notes! It will be great to keep such state in future...

git-svn-id: trunk@11455 -
2008-07-23 13:16:46 +00:00
yury
cf7390ea81 * Fixed 'mixed signed/unsigned' and pointer conversion warnings.
git-svn-id: trunk@11439 -
2008-07-23 09:36:07 +00:00
peter
6744b747b8 * remove goto, that prevents optimizations
git-svn-id: trunk@10083 -
2008-01-28 18:13:32 +00:00
Jonas Maebe
8d9bfcaa7d * fixed memory corruption in trgobj.add_to_movelist on 64 bit platforms
git-svn-id: trunk@9523 -
2007-12-25 23:39:28 +00:00
peter
6058b2c247 * renamed t_times to executionweight and moved it to
code generation pass
  * include executionweight in the spilling decision

git-svn-id: trunk@9330 -
2007-11-25 16:38:05 +00:00
peter
263b7abc6f * check register type also for registers in references so we are
not mixing addressregisters and intregisters on m68k

git-svn-id: trunk@9128 -
2007-11-04 14:24:36 +00:00
Jonas Maebe
335bc9fd46 + PIC support for darwin/ppc32 (-Cg works now, no regressions in test
suite compiled with -Cg compared to without -Cg)
  + support for using a virtual register as PIC/got base register
  * moved got loading code from ncgutil to cgobj/cgcpu (can't test whether
    it didn't break anything under linux/i386, because "make cycle OPT=-Cg"
    was already broken due to the *prt*.as -> si_*.pp changes)

git-svn-id: trunk@8651 -
2007-09-26 16:41:32 +00:00
peter
67e16340be * revert r8118
git-svn-id: trunk@8139 -
2007-07-22 19:59:00 +00:00
daniel
21293f5818 + Add common type integer promotion.
- {$intpromotion common_type} or -CIcommon_type switches to common type promotion.
    - {$intpromotion native_integer} or -CIcommon_type switches to current behaviour.
    - Default in tp mode is common_type, native_integer in other modes
    - Compiler can cycle with -CIcommon_type
    - Still needs checking on other architectures than i386

git-svn-id: trunk@8118 -
2007-07-21 19:16:24 +00:00
daniel
9adb202a92 * Rework the constexprint to allow operations from low(int64) to high(qword).
+ Some initial work on a formaldef which also carries the typinfo of a parameter.

git-svn-id: trunk@7639 -
2007-06-13 07:41:18 +00:00
daniel
182fca72f2 * Change spill_* routines to return Taicpu instead of Tai to increase
strong typing.
  * Fix PowerPC R0 register allocation

git-svn-id: trunk@7317 -
2007-05-12 15:43:16 +00:00
peter
60069ce3d2 * fix IE with -sr and EXTDEBUG
git-svn-id: trunk@5283 -
2006-11-07 22:43:34 +00:00
florian
8fe7fb5e66 * arm uses sometimes up to 4 registers in one instruction
git-svn-id: trunk@5205 -
2006-11-03 16:46:29 +00:00
florian
ef7bd58c54 * germanism removed (aktfilepos -> current_filepos)
git-svn-id: trunk@5099 -
2006-10-30 22:37:31 +00:00
florian
85d63d9fa9 * settings refactored
git-svn-id: trunk@5094 -
2006-10-30 18:02:58 +00:00
daniel
01afee1f73 * Add extra calls to get_alias to properly recognize coalesced
registers to be spilled.

git-svn-id: trunk@4997 -
2006-10-21 21:31:08 +00:00
daniel
8242fb32ab * One more line to revert
git-svn-id: trunk@4718 -
2006-09-24 17:02:42 +00:00
daniel
6abd7a7cf3 * Revert oldlasttemp stuff
git-svn-id: trunk@4717 -
2006-09-24 16:59:36 +00:00
daniel
4d3c7ac99e * Change ptrint into ptruint because $7fffffff < $80000001 should
be true.

git-svn-id: trunk@4709 -
2006-09-24 13:12:19 +00:00
peter
84d652e3c9 * remove extdebug register unused warning, it is obsolete with the ssa for registers
git-svn-id: trunk@4540 -
2006-09-03 08:30:05 +00:00
Jonas Maebe
fd4b348e7c * fixed empty superregister set detection in constructor
git-svn-id: trunk@4333 -
2006-08-03 15:15:23 +00:00
Jonas Maebe
7bb3a1fe22 * fixed register allocation of gen_load_para_value() and backwards
extension of regalloc info in general

git-svn-id: trunk@4293 -
2006-07-25 13:54:48 +00:00
peter
b7fe6797bf Merged revisions 2921-2922,2925 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/linker/compiler

........
r2921 | peter | 2006-03-15 08:35:00 +0100 (Wed, 15 Mar 2006) | 2 lines

  * pass ObjectWriter to ObjectOuput

........
r2922 | peter | 2006-03-15 12:40:30 +0100 (Wed, 15 Mar 2006) | 2 lines

  * refactor asmdata

........
r2925 | peter | 2006-03-15 16:09:39 +0100 (Wed, 15 Mar 2006) | 3 lines

  * add cfi to asmdata
  * move asmlist, asmcfi, asmdata to own unit

........

git-svn-id: trunk@2932 -
2006-03-16 08:52:22 +00:00
florian
94038b0d83 + translate register variable locations, enables register variable debug info, with SSA it requires to be extended maintaining location list
git-svn-id: trunk@2409 -
2006-02-02 21:27:23 +00:00
florian
137f8f340d * handling of address registers in references fixed
* write address registers as areg when compiling with -sr

git-svn-id: trunk@2398 -
2006-02-01 22:45:14 +00:00
Jonas Maebe
fc1b5c9fe2 * fixed backwards extension of regalloc information
git-svn-id: trunk@2193 -
2006-01-06 11:17:29 +00:00
Jonas Maebe
b769a968e3 * make sure live_start and live_end are correctly updated while
generating the initialisation and entry code

git-svn-id: trunk@2185 -
2006-01-05 17:46:16 +00:00
Jonas Maebe
7aa315c71a * made some Tcpuregisterset parameters const to avoid useless copying
git-svn-id: trunk@2176 -
2006-01-05 10:10:25 +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
peter
41c253b65d * during spilling only add deallocs to live_registers that belong
to the instruction
2005-04-07 16:25:05 +00:00
peter
e207c402fc * only in EXTDEBUG leave register allocator when it fails. Otherwise
give an IE
2005-04-07 15:42:04 +00:00
Jonas Maebe
a5c94ddccd * removed some unused variables 2005-03-25 21:55:43 +00:00
peter
5452cccaad * fix spilling code when explicit cpu registers are used in an
instruction
2005-03-20 19:47:46 +00:00
Jonas Maebe
6c38093871 * fixed spilling for several ppc instructions which only read registers
+ added support for registers in references that get changed (load/store
    with update)
2005-02-18 23:37:51 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
peter
db81b4333a * fatal error when procedure is too complex 2004-11-14 21:08:27 +00:00
florian
8ffe3c6a9e * debug writeln removed 2004-11-06 18:58:18 +00:00
florian
42e14b6825 + additional extdebug check for wrong add_reg_instructions added
* too long manglednames are cut off at 200 chars using a crc
2004-11-06 17:44:47 +00:00
peter
1cf3aef0f0 * regalloc bind to instructions need to get real ait_instruction 2004-11-01 10:34:08 +00:00
Jonas Maebe
dc71fc8290 * make sure live_start/end is never a tai_regalloc, as those can be
removed by the register allocator and thus become invalid. This fixed
    make cycle with -Or for ppc, but I'm not sure what the warning on
    symsym.pas:1663 means. Since the tlocation change, even regular make
    cycle doesn't work anymore though...
2004-10-31 23:18:29 +00:00
peter
c95a859f0a * generic tlocation
* move tlocation to cgutils
2004-10-31 21:45:02 +00:00
florian
36ca15cf07 * fixed compilation of system unit on arm 2004-10-31 16:04:30 +00:00
florian
e04b172854 * fixed generic optimizer
* enabled generic optimizer for sparc
2004-10-30 15:21:37 +00:00
peter
30be9e8e5d * during translation only process regalloc for the current regtype 2004-10-24 17:04:01 +00:00
mazen
581b52422c - remove $IFDEF DELPHI and related code
- remove $IFDEF FPCPROCVAR and related code
2004-10-15 09:14:16 +00:00
peter
60c73cc0e5 * -Or fixes for open array 2004-10-13 21:12:51 +00:00
peter
b0ebc06ce6 * removed warning about register used only once 2004-10-11 15:47:03 +00:00
peter
eaf46c4fb1 * live_registers must be restored after the spilling store code
is generate to add correct conflicts for extra temporary registers
2004-10-06 20:14:08 +00:00
peter
f5471aef6e * more spilling rewrites 2004-10-05 20:41:01 +00:00
peter
ee3585f56f * spilling code rewritten for x86. It now used the generic
spilling routines. Special x86 optimization still needs
    to be added.
  * Spilling fixed when both operands needed to be spilled
  * Cleanup of spilling routine, do_spill_readwritten removed
2004-10-04 20:46:22 +00:00
peter
8fb3536f6e * simple regvar support, not yet finished 2004-09-26 17:45:29 +00:00
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
florian
1eb575fa22 * fixed longbool(<int64>) on sparc 2004-08-24 21:02:32 +00:00
daniel
c4e909e316 * Add check <= 255 when adding to adj_colours 2004-07-09 21:38:30 +00:00
daniel
649bd81edb * Use a normal pascal set in assign_colours, since it only will contain
real registers
2004-07-08 09:57:55 +00:00
daniel
d2a2aeac9f * supregset_reset clears 8kb of memory. However, it is being called in
inner loops, see for example colour_registers. According to profile data
    this causes fillchar to be the most time consuming procedure.
    Some modifications done to make it clear less than 8kb of memory each
    call. Divides time spent in fillchar by two, but it still is the no.1
    procedure.
2004-07-07 17:35:26 +00:00
florian
34d634c64d * fixed arm compilation 2004-06-22 18:24:18 +00:00
florian
8a9758c5e2 * logs truncated 2004-06-20 08:55:28 +00:00
florian
e9bb27df36 * spilling of doubles on sparc fixed 2004-06-20 08:47:33 +00:00
florian
588e2c38bf * dwarf branch merged 2004-06-16 20:07:06 +00:00
peter
5358278ca1 tai_regalloc.allocation changed to ratype to notify rgobj of register size changes 2004-05-22 23:34:27 +00:00
Jonas Maebe
b20d72aa36 * do not remove "allocation,deallocation" pairs, as those are important
for the optimizer
2004-04-26 19:57:50 +00:00
peter
3a5717c1b7 * rewrote add_to_movelist, it now uses a field to store the number
of allocated entries. Also made it using less hardcoded values
2004-03-14 22:50:04 +00:00
peter
56c727153a * check if movelist is valid 2004-03-14 20:06:17 +00:00
peter
ee569d7817 * make extcycle is working again 2004-02-12 15:54:03 +00:00
olle
193e41b455 + check that register allocation is not made at the wrong moment 2004-02-09 20:12:23 +00:00
Jonas Maebe
71202a141d * taicpu.is_same_reg_move() now gets a regtype parameter so it only
removes moves of that particular register type. This is necessary so
    we don't remove the live_start instruction of a register before it
    has been processed
2004-02-08 23:10:21 +00:00
daniel
9868155d53 * Register allocator speed boost 2004-02-08 14:26:28 +00:00
daniel
46d241a666 * Take advantage of our new with statement optimization 2004-02-07 23:28:34 +00:00
daniel
be3eabc26f * Some changes to better accomodate very large movelists
* movelist resizing now exponential (avoids heap fragmentation, saves
      300 kb memory in make cycle)
    * Trgobj.combine hand-optimized (still too slow)
2004-02-06 13:34:46 +00:00
peter
8caaa7740d * more record alignment fixes 2004-01-28 22:16:31 +00:00
florian
8ef2f96215 * made DoSpill* overrideable
+ add_cpu_interferences added
2004-01-26 17:40:11 +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
daniel
ecf7accc38 * Keep interference bitmap only allocated during register allocation.
Saves 2 mb of memory.
2004-01-25 23:21:02 +00:00
peter
c34c9af5ce * moved spilling code from taicpu to rg 2004-01-12 16:37:59 +00:00
daniel
61d29c4e4e * Register allocation bug fixed 2004-01-11 13:21:35 +00:00
daniel
cdbb601a4e * Degree=0 problem fixed
* Degree to high problem fixed
2004-01-09 22:02:29 +00:00
peter
1c7e6fc380 * sparc updates
* use registertype in spill_register
2003-12-26 14:02:30 +00:00
peter
0734904796 * only report unreleased imaginary registers 2003-12-22 23:09:34 +00:00
peter
cc8d2226ae * made decrease_degree working, but not really fixed 2003-12-22 22:13:46 +00:00
florian
78aeec22ca * arm compiler compilation fixed 2003-12-18 17:06:21 +00:00
peter
bc4f29e15c * don't insert dealloc before alloc of the same register 2003-12-17 21:59:05 +00:00