Commit Graph

820 Commits

Author SHA1 Message Date
florian
d540d56908 * unified internal errors
git-svn-id: trunk@29280 -
2014-12-13 11:46:59 +00:00
florian
5c67fcc43f + change always floating point divisions into multiplications if they are a power of two,
this is an exact operation so it is always allowed
* change only divisions by normal numbers into multiplications

git-svn-id: trunk@29085 -
2014-11-16 20:47:38 +00:00
Tomas Hajny
3ee3542744 * boolean constant instead of IFDEFs for detection of microcontroller support
git-svn-id: trunk@29052 -
2014-11-10 12:34:59 +00:00
pierre
aa6b62cf4c Add new procedure option: po_syscall_has_libsym,
include this option only of libsym field
 is non NIL.
 Use this option to only write redef of libsym if needed.
 Adapt ppudump source to this new procedure option.

git-svn-id: trunk@28732 -
2014-10-03 19:26:16 +00:00
Károly Balogh
c22dd6f022 PowerPC: in MorphOS syscalls the explicit paraloc size should always be OS_ADDR
git-svn-id: trunk@28686 -
2014-09-18 10:25:28 +00:00
Károly Balogh
6122db7d40 * fix warnings when compiling the compiler with DFA optimizer enabled on PowerPC
git-svn-id: trunk@28501 -
2014-08-20 14:31:36 +00:00
nickysn
7cfd7a66cd + create a special 'heap' segment with reserved space equal to heapsize (i.e.
the value set by -Ch or the second parameter to the $M directive). This is
  equivalent to the heapmin value in Turbo Pascal 7 and ensures that the program
  has at least this amount of heap space available (otherwise DOS will show a
  'not enough memory' error and will refuse to load the program).

git-svn-id: trunk@28002 -
2014-06-19 14:14:01 +00:00
sergei
9593cece03 * powerpc: implement cg.a_mul_reg_reg_pair method and switch to generic code for division by constants.
git-svn-id: trunk@27976 -
2014-06-15 16:33:08 +00:00
nickysn
3cc8ff11e3 + generate the stack segment for i8086 far data memory models from within fpc
itself (instead of having a fixed 16k stack in the startup code). This allows
  setting the stack size in these models with the -Cs option.

git-svn-id: trunk@27820 -
2014-05-27 23:29:50 +00:00
sergei
5fe27ae815 * powerpc/powerpc64: Fixed floating point compares to be IEEE-754 compliant. Mantis #9362.
git-svn-id: trunk@27604 -
2014-04-19 19:54:24 +00:00
sergei
a8eb55fa7c * powerpc/powerpc64: merged identical a_jmp_flags methods into base code generator class.
git-svn-id: trunk@27598 -
2014-04-19 18:34:10 +00:00
sergei
af52c874d0 - Removed some stuff that is not used anywhere.
git-svn-id: trunk@27595 -
2014-04-18 18:34:53 +00:00
sergei
c0431dba4e * Moved method g_flag2reg from tcgppc (in both powerpc and powerpc64) to tcgppcgen class, since it is identical for both targets.
git-svn-id: trunk@27589 -
2014-04-16 15:00:49 +00:00
svenbarth
02495c17bd Fix a typo. The CPU specific version of "ttypesym" should be called "tcputypesym" and not "tcpuypesym".
git-svn-id: trunk@27531 -
2014-04-11 14:30:59 +00:00
sergei
96dd464bf2 * Moved fixup_jmps to target-specific classes for powerpc,powerpc64 and MIPS, cleaned out remaining $ifdef's. A slight functionality change is that fixup_jmps is now called before adding the procedure end symbol, not after, but that should not matter.
git-svn-id: trunk@27450 -
2014-04-02 14:17:23 +00:00
Jonas Maebe
d452686c39 * moved pbestrealtype from symdef to symcpu
git-svn-id: trunk@27441 -
2014-04-01 21:41:37 +00:00
Jonas Maebe
9c7c64a3af * moved amiga/morphos-specific libsym-related field from tprocdef to
cpu-specific descendants (unfortunately causes some duplication, but the
    code is trivial and there is no easy way to avoid it)
  * also moved the use of the field in ncal to cpu-specific files (with same
    caveat)

git-svn-id: trunk@27438 -
2014-04-01 21:41:27 +00:00
Jonas Maebe
dae5d1ff62 + added class reference types of the architecture-specific t*def/t*sym
classes

git-svn-id: trunk@27396 -
2014-03-30 21:04:32 +00:00
Jonas Maebe
b57c95043f + support overriding tdef/tsym methods with target-specific functionality:
o made all (non-abstract) tdef and tsym constructors virtual
   o added c*def/c*sym classref types for every (non-abstract) t*def/t*sym
     class
   o added cpusym unit for every architecture that derives a tcpu*def/tcpu*sym
     class from the base classes, and initialises the c*def/c*sym classes with
     them. This is done so that the llvm target will be able to derive from
     the tcpu*def/sym classes without umpteen ifdefs, and it also means that
     the WPO can devirtualise everything because the c* variables are only
     initialised with one class type
   o replaced all t*def/t*sym constructor calls with c*def/c*sym constructor
     calls

git-svn-id: trunk@27361 -
2014-03-29 22:31:55 +00:00
Jonas Maebe
868b4f50e9 * use spilling_operation_type() instead of a big table to determine whether
instructions overwrite operand 0 (fixes wrongly handled rlwimi and some
    others, and also adds support for loads/stores)

git-svn-id: trunk@26653 -
2014-02-02 15:32:54 +00:00
pierre
5e6669890a Handle asmextraopt in powerpc, mips and sparc assemblers
git-svn-id: trunk@26542 -
2014-01-21 00:19:17 +00:00
pierre
3f33fdd445 Handle asmextraopt in powerpc assmeblers
git-svn-id: trunk@26541 -
2014-01-21 00:17:56 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
svenbarth
c48d572996 Implement support for saving and restoring address registers.
cgobj.pas, tcg:
  * g_save_registers: add the amount of used address registers to size as well
  * g_save_registers: save all used address registers
  * g_restore_registers: restore all stored address registers
m68k/cpubase.pas:
  * rename saved_standard_address_registers to saved_address_registers
all other platform's cpubase.{inc,pas} (except alpha, ia64 and vis which are not up to date):
  * add a saved_address_registers variable with one entry of RS_INVALID

At least a "make fullcycle" did complete.

git-svn-id: trunk@25664 -
2013-10-05 21:43:42 +00:00
sergei
108d3cb090 - Removed tai_label.is_global field, was used in just one place and is generally not needed: binding is controlled by 'bind' property of referenced AsmLabel.
git-svn-id: trunk@25336 -
2013-08-23 11:34:08 +00:00
Jonas Maebe
9938169d2c * don't use the paracgsize in get_paraloc_def(), because it generally
contains the tcgsize of the entire parameter rather than only of
    what is left (-> calculate it from the remaining parameter length)

git-svn-id: trunk@24776 -
2013-06-02 14:05:07 +00:00
Jonas Maebe
7566ddcc8f * add a tdef to each parameter location and set it for all target
backends (not yet used, will be used in high level code generator)

git-svn-id: trunk@24761 -
2013-06-02 10:24:02 +00:00
Jonas Maebe
2b78bb1674 - removed ppc-specific tcgpara.composite field, it's no longer used or
necessary

git-svn-id: trunk@23581 -
2013-02-06 15:37:50 +00:00
Jonas Maebe
69c29a415f * pass the procdef to getintparaloc instead of only the proccalloption, so
that the type of the parameters can be determined automatically
   o added compilerproc declarations for all helpers called in the compiler
     via their assembler name, so we can look up the corresponding procdef

git-svn-id: trunk@23325 -
2013-01-06 15:05:40 +00:00
florian
7ac9f11cc7 * check if current_procinfo is assigned in paramanager code to avoid crashes
git-svn-id: trunk@23303 -
2013-01-03 23:00:03 +00:00
masta
e327b4581c Use TRegNameTable instead of array[tregisterindex] of string[10]
TRegNameTable is defined in compiler/rgbase.pas and is an array of
strings, limited to the maximum length of the used register names.

r22792 added a long register name but did not scale the string-size
enough, resulting in the compiler built breaking for arm.

git-svn-id: trunk@22817 -
2012-10-22 10:23:21 +00:00
Jonas Maebe
6497d3c994 - removed no longer used/supported af_allowdirect flag (direct assembler
reader support)

git-svn-id: trunk@22794 -
2012-10-21 13:42:58 +00:00
Jeppe Johansen
0087661fb5 Added FPv4_d16 FPU instructions, and a few extra registers
git-svn-id: branches/laksen/arm-embedded@22596 -
2012-10-08 20:04:14 +00:00
florian
4dee21c60e + NR_DEFAULTFLAGS and RS_DEFAULTFLAGS for all CPUs with flags added
git-svn-id: trunk@22181 -
2012-08-22 19:38:27 +00:00
florian
d2aa35e9de * throw an internal error if code generation depends on expectloc but expectloc and real loc do not match
git-svn-id: trunk@22073 -
2012-08-13 15:02:55 +00:00
florian
4d86d25c6c * -O4 switch for optimizations which are correct but which might have unexpected effects
like field reordering (possible problems cracker classes) or using ebp as normal register (broken
      stack traces from dump_stack)
    + niln is also valid in a cse domain
    * parameters passed by reference shall have a complexity >1
    * load nodes from outer scopes shall have a complexity >1
    * better cse debugging
    + more node types added to cse
    * consider parameters passed by reference in cse
    * take care of cse in parameters in simple cases

git-svn-id: trunk@22050 -
2012-08-09 18:58:54 +00:00
florian
b330bba0bc + introduce -Oofastmath
* limit the application of the tree transformation introduced in r21986 to safe cases and -Oofastmath

git-svn-id: trunk@22040 -
2012-08-08 19:35:45 +00:00
florian
eb1efdff8a + introduce cstylearrayofconst because pocall_mwcall was forgotten at several places
git-svn-id: trunk@22012 -
2012-08-05 08:48:23 +00:00
Jonas Maebe
0a1157da38 * fixed memory leaks in the compiler introduced in r21862 by marking and
releasing temporarily created function result locations

git-svn-id: trunk@21953 -
2012-07-23 13:49:29 +00:00
Jonas Maebe
3798b79fd7 + optimization that (re)orders instance fields of Delphi-style classes in
order to minimise memory losses due to alignment padding. Not yet enabled
    by default at any optimization level, but can be (de)activated separately
    via -Oo(no)orderfields
   o added separate tdef.structalignment method that returns the alignment
     of a type when it appears in a record/object/class (factors out
     AIX-specific double alignment in structs)
   o changed the handling of the offset of a delegate interface
     implemented via a field, by taking the field offset on demand
     rather than at declaration time (because the ordering optimization
     causes the offsets of fields to be unknown until the entire
     declaration has been parsed)

git-svn-id: trunk@21947 -
2012-07-22 16:47:19 +00:00
Jonas Maebe
92b4c84dae * fixed 'int64 shl/shr 0' on ppc32
git-svn-id: trunk@21841 -
2012-07-10 09:24:26 +00:00
Jonas Maebe
7a0ae38700 + also specify the parameter def when allocating a parameter via
getintparaloc + adapted all call sites of getintparaloc. This
    led to a number of additional, related changes:
   o corrected the type information for some getintparaloc parameters
   o don't allocate some intparalocs in cases they aren't used
   o changed "const tvardata" parameter into "constref tvardata" for
     fpc_variant_copy_overwrite to make pass-by-reference semantics
     explicit
   o moved a number of routines that now have to call find_system_type()
     from cgobj to hlcgobj so that cgobj doesn't have to start depending
     on the symtable unit
   o added versions of the cpureg alloc/dealloc methods to hlcgobj that
     call through to their cgobj counter parts, so we can call save/restore
     the cpu registers before/after calling system helpers from hlcgobj
     (not implemented in hlcgobj itself, because all basic register
      allocator functionality is still part of cgobj/cgcpu)

git-svn-id: trunk@21696 -
2012-06-24 15:02:12 +00:00
Jonas Maebe
c3ea451aea * set tcgpara.vardef when creating parameter info
git-svn-id: trunk@21693 -
2012-06-24 15:01:54 +00:00
Jonas Maebe
2d48396587 - removed redundant checks
git-svn-id: trunk@21692 -
2012-06-24 15:01:48 +00:00
Jonas Maebe
587244c088 * factored out common code from get_funcretloc()
* set tcgpara.def for the function return location (field introduced for and
    already used by the JVM code generator, required for future hlcg
    functionality)

git-svn-id: trunk@21691 -
2012-06-24 15:01:42 +00:00
Jonas Maebe
708a2532fc * consistently define empty saved_mm_registers arrays as containing a single
RS_INVALID superregister (instead of sometimes RS_NO and sometimes
    RS_INVALID)
  * check for RS_INVALID in tcg.g_save_registers() and ignore such entries

git-svn-id: trunk@21622 -
2012-06-15 18:24:25 +00:00
Jonas Maebe
df99ef17b6 + mfpvr, mfdcr, mtdcr, mfdec and mtdec opcodes (mantis #18878)
git-svn-id: trunk@21500 -
2012-06-06 18:17:55 +00:00
Jonas Maebe
edd42aa42a * moved subsetref/reg and bit_set/test support from cgobj to hlcgobj for
future use by high level code generator targets
   o this in turn required that all a_load*_loc* methods are called via
     hlcg rather than via cg, since a location can be a subsetref/reg and
     and those are no longer handled in tcg
   o that then required moving several force_location_* routines into
     thlcg because they use a_load_loc*, but did not take tdef size
     parameters (which are required by the thlcg a_load_loc* routines)
   o the only practical consequence is that from now on, you have to
     use hlcg.location_force_mem/reg() (fpureg not yet) and
     hlcg.gen_load_loc_cgpara() instead of the removed versions from ncgutil,
     and hlcg.a_load*loc*() instead of cg.a_load*loc* if a subsetref/reg
     might be involved

git-svn-id: trunk@21287 -
2012-05-13 12:33:10 +00:00
Jonas Maebe
85a3fd3357 + ossinttype/osuinttype defs that correspond to OS_SINT/OS_INT for use in
the high level code generator

git-svn-id: trunk@21279 -
2012-05-12 16:03:15 +00:00
Jonas Maebe
834026bfb5 * synchronised with trunk up to r21067
git-svn-id: branches/jvmbackend@21068 -
2012-04-26 21:24:20 +00:00