Commit Graph

811 Commits

Author SHA1 Message Date
florian
04543b179f o merge of the branch laksen/arm-embedded of Jeppe Johansen:
fixes a couple of arm-embedded stuff, 
  adds some controllers, start of fpv4_s16 support, for a complete list of
  changes see below:
------------------------------------------------------------------------
r22787 | laksen | 2012-10-20 22:00:36 +0200 (Sa, 20 Okt 2012) | 1 line

Properly do NR_DEFAULTFLAGS detection/allocation/deallocation
------------------------------------------------------------------------
r22782 | laksen | 2012-10-20 07:44:55 +0200 (Sa, 20 Okt 2012) | 1 line

Fixed flags detections code for wide->short optimization code for Thumb-2
------------------------------------------------------------------------
r22778 | laksen | 2012-10-19 20:23:14 +0200 (Fr, 19 Okt 2012) | 1 line

Added coprocessor registers, and support for 6 operands(MCR/MRC instructions, etc)
------------------------------------------------------------------------
r22647 | laksen | 2012-10-14 21:28:08 +0200 (So, 14 Okt 2012) | 1 line

Added register specifications to lpc1768.pp. From Joan Duran
------------------------------------------------------------------------
r22646 | laksen | 2012-10-14 21:10:20 +0200 (So, 14 Okt 2012) | 4 lines

Fixed some minor formating issues
Implemented a small heap mananger
Implemented console IO
Changed default LineEnding to CrLf(to ease console IO parsing)
------------------------------------------------------------------------
r22599 | laksen | 2012-10-09 08:58:58 +0200 (Di, 09 Okt 2012) | 1 line

Added all STM32F1 configurations
------------------------------------------------------------------------
r22597 | laksen | 2012-10-08 22:10:45 +0200 (Mo, 08 Okt 2012) | 1 line

Added initial support for the Cortex-M4F FPv4_S16 FPU
------------------------------------------------------------------------
r22596 | laksen | 2012-10-08 22:04:14 +0200 (Mo, 08 Okt 2012) | 1 line

Added FPv4_d16 FPU instructions, and a few extra registers
------------------------------------------------------------------------
r22592 | laksen | 2012-10-08 16:07:40 +0200 (Mo, 08 Okt 2012) | 2 lines

Added support for IT block merging
Added a peephole pattern check for UXTB->UXTH chains
------------------------------------------------------------------------
r22590 | laksen | 2012-10-08 14:30:00 +0200 (Mo, 08 Okt 2012) | 3 lines

Add CBNZ/CBZ instructions
Create preliminary Thumb-2 PeepHoleOptPass2 code, hacked together from the ARM mode code
Added a number of simple size optimizations for common Thumb-2 instructions
------------------------------------------------------------------------
r22582 | laksen | 2012-10-08 06:49:39 +0200 (Mo, 08 Okt 2012) | 3 lines

Fix optimizations of Thumb-2 code
Fix problem with loading of condition operand for IT instructions
Properly split IT blocks when register allocator tries to spill inside a block.
------------------------------------------------------------------------
r22581 | laksen | 2012-10-08 05:15:40 +0200 (Mo, 08 Okt 2012) | 4 lines

Fixed assembler calling command line for cpus>ARMv5TE. EDSP instructions will generate errors while assembling, due to RTL assembler routines
Updated boot code for all Cortex-M3 controllers, and sc32442b to use weak linking for exception tables.
Cortex-M3 devices now also share initialization routine to simplify maintenance
STM32F10x classes now have specific units which fit the interrupt source names and counts
------------------------------------------------------------------------
r22580 | laksen | 2012-10-08 05:10:44 +0200 (Mo, 08 Okt 2012) | 2 lines

Added support for .section, .set, .weak, and .thumb_set directive for GAS assembler reader
IFDEF'ed JVM specific assembler directives, to prevent ait_* set to exceed 32 elements
------------------------------------------------------------------------
r22579 | laksen | 2012-10-08 02:10:52 +0200 (Mo, 08 Okt 2012) | 3 lines

Remove all traces of the interrupt vector table generation mechanism
Clean up cpuinfo tables
Fixed ARMv7M bug(BLX <label> doesn't exist on that version)

git-svn-id: trunk@22792 -
2012-10-21 08:39:52 +00:00
svenbarth
7ffd6c61a1 m68k/n68kmat.pas, tm68knotnode.pass_generate_code:
* correctly handle the case "expectloc = LOC_JUMP"
  * make internal error unique

git-svn-id: trunk@22790 -
2012-10-20 21:05:17 +00:00
svenbarth
5bb0e5992b * m68k/n68kadd.pas, t68kaddnode.second_cmpboolean:
don't use "location.loc" if second_pass was not called on the node yet, but "expectloc"
* added test

git-svn-id: trunk@22789 -
2012-10-20 20:32:46 +00:00
svenbarth
b6eac7a31b n68kmat.pas, tm68knotnode.pass_generate_code:
fix the double running of second_pass in the way it was intended to work: check for left.expectloc instead of left.location.loc

git-svn-id: trunk@22788 -
2012-10-20 20:31:01 +00:00
svenbarth
f746d9603a * m68k/n68kadd.pas, t68kaddnode.second_cmpsmallset:
respect more location combinations than just LOC_CONSTANT and LOC_REGISTER
* added test

git-svn-id: trunk@22786 -
2012-10-20 19:39:29 +00:00
svenbarth
72a01f17f5 * m68k/n68kmat.pas, tm68knotnode.pass_generate_code:
It is a bad idea (TM) to do a second_pass twice on the same node
* added test

git-svn-id: trunk@22785 -
2012-10-20 18:23:35 +00:00
pierre
6bc6036fd5 Set cai_align and cai_cpu
git-svn-id: trunk@22769 -
2012-10-19 15:38:39 +00:00
pierre
963e211644 Try to add all add_move_instruction calls
git-svn-id: trunk@22768 -
2012-10-19 15:38:11 +00:00
pierre
0b404fea69 * more 68000 fixref changes
git-svn-id: trunk@22764 -
2012-10-19 12:34:41 +00:00
pierre
f81954760b More 68000 restrictions taken into account for fixref and TST instruction
git-svn-id: trunk@22762 -
2012-10-19 11:54:05 +00:00
pierre
b104d9c9e6 Add some missing instructions to spilling_get_operation_type method
git-svn-id: trunk@22760 -
2012-10-19 10:18:16 +00:00
pierre
d472b40149 Move conversion to address register of base reference to common code in fixref
git-svn-id: trunk@22759 -
2012-10-19 09:57:49 +00:00
pierre
34279864ef Remove double cgutils in uses clause
git-svn-id: trunk@22758 -
2012-10-19 07:31:18 +00:00
svenbarth
825fa86824 Added missing unit for tcpuregisterset
git-svn-id: trunk@22754 -
2012-10-18 20:39:35 +00:00
svenbarth
a01677e546 Removed debug line
git-svn-id: trunk@22751 -
2012-10-18 20:12:37 +00:00
svenbarth
ca6ca31953 The message scan_f_illegal_char seems to have gained additional parameters since it was
introduced. Take that into account to avoid an access violation.

git-svn-id: trunk@22749 -
2012-10-18 20:12:28 +00:00
svenbarth
75baec5985 Mark all integer registers as volatile.
git-svn-id: trunk@22747 -
2012-10-18 20:12:20 +00:00
svenbarth
d9a61f2082 * make internal error unique
* add MULU and MULS to taicpu.get_spilling_operation_type

git-svn-id: trunk@22746 -
2012-10-18 20:12:16 +00:00
svenbarth
ff0eebf1ff Also change RTL helper FPC_DIV_CARDINAL to FPC_DIV_DWORD
git-svn-id: trunk@22745 -
2012-10-18 20:12:12 +00:00
svenbarth
8e07ddb2bc * made internal errors for M68K unique
* fixed comment
* added comment regarding the potential usage of an address register instead of an int one

git-svn-id: trunk@22744 -
2012-10-18 20:12:07 +00:00
svenbarth
786e814d49 Use the correct frame pointer register: A6 on Unixes and A5 on everything else. The only
open question is embedded systems (currently it counts as "everything else").

git-svn-id: trunk@22741 -
2012-10-18 20:11:49 +00:00
svenbarth
43d8da7aa3 Replace DBRA instruction for Coldfire with a SUB/BRA combination in the for-loop-code-
generation and the assembly helpers in the RTL as DBRA is not supported by Coldfire.

git-svn-id: trunk@22740 -
2012-10-18 20:11:45 +00:00
svenbarth
d5523e6af6 For now completely disable (I)MUL/(I)DIV support for Coldfire and pass through the RTL routines
(of which the names had changed from FPC_MUL_LONGWORD->FPC_MUL_DWORD and FPC_MOD_CARDINAL->
FPC_MOD_DWORD).
Also disable the usage of FPU opcodes for Coldfire.

git-svn-id: trunk@22739 -
2012-10-18 20:11:39 +00:00
svenbarth
dea2a205c9 Fixed reference handling mostly for Coldfire CPUs. While they are conceptually based on
M68000 CPUs they are nevertheless more restricted in some cases, so these need to be
handled explicitely (especially if symbols are involved).

git-svn-id: trunk@22738 -
2012-10-18 20:11:33 +00:00
svenbarth
72a47ea27a m68k/cgcpu.pas, tcg68k.g_proc_exit:
* generate special return code for non-68020 CPU which don't support RTD instruction (based on
  out code a few lines further down)

git-svn-id: trunk@22736 -
2012-10-18 20:11:25 +00:00
svenbarth
0217efc398 m68k/ag68kgas.pas, getreferencestring:
It seems that GNU as needs the syntax "offset(register.size*scale)" if the base address
  register is ommited instead of "offset(,register.size*scale)". Now the System unit
  assembles and nearly the complete RTL can be built.

git-svn-id: trunk@22734 -
2012-10-18 20:11:15 +00:00
svenbarth
cfadcf3769 m68k/cgcpu.pas, tcg68k.a_op_const_reg:
leave "and" and "or" as "and" and "or" as according to the assembly language reference the
  assembler should automatically choose the correct instruction (though Coldfire still should
  be tested for ORI/ANDI to CCR

git-svn-id: trunk@22733 -
2012-10-18 20:11:09 +00:00
svenbarth
f501a8fecc m68k/cgcpu.pas, tcg68k.a_op_const_reg:
* use andi/ori for constant values
  * use a scratch register if target is an address register (there seems to exist an omnious
    anda/ora instruction though, but GNU as doesn't seem to handle it... maybe I haven't set
    the CPU type correctly, so I'll need to investigate this so we can hopefully remove the
    need for a scratch register for certain CPU types ;) )

git-svn-id: trunk@22732 -
2012-10-18 20:11:02 +00:00
svenbarth
9402a068a5 m68k/n68kcnv.pas, tm68ktypeconvnode.second_int_to_bool:
* remove comments regarding needed LOC_JUMP implementation
* don't call flags2reg if the location is LOC_JUMP as there isn't a register to set the flags to
  (this allows fpc_mul_qword and fpc_mul_int64 to be assembled)

git-svn-id: trunk@22731 -
2012-10-18 20:10:56 +00:00
svenbarth
07c3cff61d m68k/n68kcnv.pas, tm68ktypeconvnode.second_int_to_bool:
implement case "LOC_JUMP" (with a more or less blindly copy from
  x86/nx86cnv.pas, tx86typeconvnode.second.int_to_bool; this now allows that the system unit can
  be compiled, but not yet assembled

git-svn-id: trunk@22728 -
2012-10-18 20:10:43 +00:00
svenbarth
05e37e3ab1 m68k/cgcpu.pas, tcg68k: implement a_jmp_name
git-svn-id: trunk@22726 -
2012-10-18 20:10:33 +00:00
svenbarth
e87f0e1df4 m68k/ra68kmot.pas, tm68kmotreader.Assemble:
the asmr_d_*_reading messages need an argument which specifies in which style the assembler code
  is read; this is most importantly used on i386; on m68k we currently don't have multiple styles,
  so simply disable these messages

git-svn-id: trunk@22725 -
2012-10-18 20:10:29 +00:00
svenbarth
83da4592d3 m68k/aasmcpu, taicpu.spilling_get_operation_type: add support for A_SUBX
git-svn-id: trunk@22724 -
2012-10-18 20:10:24 +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
283ff05127 * merged avx support in inline assembler developed by Torsten Grundke
git-svn-id: trunk@22568 -
2012-10-06 19:47:18 +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
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
d6066ed51a * fixed compilation for i386/m68k after r21878/21879
git-svn-id: trunk@21884 -
2012-07-11 17:41:18 +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
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
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
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
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
Jonas Maebe
ac43eb9b70 + generic implementation of ReplaceForbiddenAsmSymbolChars() instead
of the AVR-specific ifdef'ed variant
   o since the only special character we use in mangled names on all platforms
     is $, added a new field to tasminfo called "dollarsign" that holds the
     character $'s should be replaced with (if it doesn't have to be replaced,
     leave it at $)

git-svn-id: trunk@20801 -
2012-04-11 18:01:57 +00:00
florian
2f5ce095ce * RefsHaveIndexReg -> cpurefshaveindexreg
* cpurefshaveindexreg defined properly in fpcdefs.inc

git-svn-id: trunk@20504 -
2012-03-10 19:43:52 +00:00
pierre
33800a0b59 * Avoid warnings and add create_varargs_paraloc_info method
git-svn-id: trunk@19575 -
2011-11-03 10:04:54 +00:00
Jonas Maebe
28740dce2d - removed extra "fordefinition" parameter again from tprocdef.mangledname(),
since the definition-specific adorning of JVM mangled names is Jasmin-
    specific, and such code has no place in symdef
  * moved code to adorn JVM mangled names for Jasmin definitions to agjasmin

git-svn-id: branches/jvmbackend@18346 -
2011-08-20 07:49:31 +00:00
Jonas Maebe
0ee702b3a2 * tprocdef.mangledname now gets an extra boolean parameter indicating
whether the mangled name is for defining a symbol, or for referencing
    it later (e.g. for a call or load of its address). The reason is that
    on the JVM both cases are different.
  + jvmdef unit to encode types according to the JVM rules
  + tprocdef.jvmmangledname() to encode a procdef's JVM mangled name
    (the common part of defining/referencing it; tprocdef.mangledname
     afterwards adorns it as required)

git-svn-id: branches/jvmbackend@18288 -
2011-08-20 07:22:00 +00:00
Jonas Maebe
72e9cfee24 * create/destroy also the high level code generator for all architectures,
so it can be used in generic code

git-svn-id: branches/jvmbackend@18280 -
2011-08-20 07:21:16 +00:00
florian
26850e3425 * fix full cycle after adding new boolean types
git-svn-id: branches/pasboolxx@17847 -
2011-06-27 20:11:08 +00:00
florian
77f2d6cc0d * introduce usage of TCGInt in the code generator units
git-svn-id: trunk@17459 -
2011-05-14 17:58:23 +00:00
svenbarth
96116a6c3a Several adjustments because virtual methods in helpers are just normal methods and a VMT isn't generated for them either.
* $CPU/cgcpu.pas: disable the generation of VMT loading code
* dbgstabs.pas, dbgdwarf.pas: treat virtual methods of helpers as normal methods
* ncgcal.pas: don't register virtual helper methods for WPO 
* ncgrtti.pas: write virtual helper methods as normal methods to RTTI
* nobj.pas: correctly handle final and override cases in helpers
* pdecvar.pas: property getters
* rautils.pas: no VMT offset in records

git-svn-id: branches/svenbarth/classhelpers@17150 -
2011-03-20 10:41:45 +00:00
paul
b317139006 compiler: fix compilation problems caused by tprocdef._class -> tprocdef.struct rename which was found by make fullcycle
git-svn-id: branches/paul/extended_records@16530 -
2010-12-10 06:50:58 +00:00
joost
07bf44517c * Merged XPCom branch into trunk, added support for constref and changed
the IInterface implementation to be XPCom-compatible
--- Merging r15997 through r16179 into '.':
U    rtl/inc/variants.pp
U    rtl/inc/objpash.inc
U    rtl/inc/objpas.inc
U    rtl/objpas/classes/persist.inc
U    rtl/objpas/classes/compon.inc
U    rtl/objpas/classes/classesh.inc
A    tests/test/tconstref1.pp
A    tests/test/tconstref2.pp
A    tests/test/tconstref3.pp
U    tests/test/tinterface4.pp
A    tests/test/tconstref4.pp
U    tests/webtbs/tw10897.pp
U    tests/webtbs/tw4086.pp
U    tests/webtbs/tw15363.pp
U    tests/webtbs/tw2177.pp
U    tests/webtbs/tw16592.pp
U    tests/tbs/tb0546.pp
U    compiler/sparc/cpupara.pas
U    compiler/i386/cpupara.pas
U    compiler/pdecsub.pas
U    compiler/symdef.pas
U    compiler/powerpc/cpupara.pas
U    compiler/avr/cpupara.pas
U    compiler/browcol.pas
U    compiler/defcmp.pas
U    compiler/powerpc64/cpupara.pas
U    compiler/ncgrtti.pas
U    compiler/x86_64/cpupara.pas
U    compiler/opttail.pas
U    compiler/htypechk.pas
U    compiler/tokens.pas
U    compiler/objcutil.pas
U    compiler/ncal.pas
U    compiler/symtable.pas
U    compiler/symsym.pas
U    compiler/m68k/cpupara.pas
U    compiler/regvars.pas
U    compiler/arm/cpupara.pas
U    compiler/symconst.pas
U    compiler/mips/cpupara.pas
U    compiler/paramgr.pas
U    compiler/psub.pas
U    compiler/pdecvar.pas
U    compiler/dbgstabs.pas
U    compiler/options.pas
U    packages/fcl-fpcunit/src/testutils.pp

git-svn-id: trunk@16180 -
2010-10-17 20:58:22 +00:00
pierre
7f200ab27e * Use asmsearchsym in assembler readers
git-svn-id: trunk@16104 -
2010-10-08 07:58:18 +00:00
Jonas Maebe
f13f6627c4 * moved use_fixed_stack from cgutils to a method in paramgr so it can
be used outside the code generator
  * renamed tabstractprocdef.requiredargarea into callerargareasize,
    and also added calleeargareasize field; added init_paraloc_info(side)
    method to init the parameter locations and init those size fields and
    replaced all "if not procdef.has_paraloc_info then ..." blocks with
    procdef.init_paraloc_info(callersize)"
  * moved detection of stack tainting parameters from psub to
    symdef/tabstractprocdef
  + added tcallparanode.contains_stack_tainting_call(), which detects
    whether a parameter contains a call that makes use of stack paramters
  * record for each parameter whether or not any following parameter
    contains a call with stack parameters; if not, in case the current
    parameter itself is a stack parameter immediately place it in its
    final location also for use_fixed_stack platforms rather than
    first putting it in a temporary location (part of mantis #17442)
  * on use_fixed_stack platforms, always first evaluate parameters
    containing a stack tainting call, since those force any preceding
    stack parameters of the current call to be stored in a temp location
    and copied to the final location afterwards

git-svn-id: trunk@16050 -
2010-09-26 21:24:14 +00:00
Jonas Maebe
283018a3bf * changed tprocdef.funcretloc[] from a tlocation into a tcgpara so it can
represent complex locations (required for full x86-64 ABI support,
    which is not yet implemented) -> lots of special result handling
    code has been removed and replaced by the parameter handling
    routines
  + added support for composite parameters (and hence function
    results) to tcg.a_load_ref_cgpara() (so it can be used for
    handling, e.g., 64 bit parameters on 32 bit platforms)
  * the above fixed writing past the end of allocated memory when
    handling records returned in registers on x86-64 whose size is
    not a multiple of 8 bytes (mantis #16357)
  - removed the x86-64 and PPC specific versions of a_load_ref_cgpara(),
    as they are now handled correctly by the generic version
  * moved the responsibility of allocating tcgpara cpu registers
    (using paramanager.allocparaloc()) from the callers of
    cg.a_load*_cgpara() to the cg.a_load*_cgpara() methods
    themselves (so the register allocation can be done efficiently
    when dealing with function results)
  * for the above, renamed paramanager.alloc/freeparaloc() to
    paramanager.alloc/freecgpara(), and use paramanager.allocparaloc()
    to allocate individual pcgparalocations instead
  * fixed the register size of SSE2 function result registers for
    x86-64 (when used for floating point), which results in removing
    a few superfluous "movs? %xmm0,%xmm0" instructions
  * fixed compilation of paramanagers of avr, m68k and mips after r13695
    and also updated them for these new changes

git-svn-id: trunk@15350 -
2010-05-30 21:12:57 +00:00
Jonas Maebe
9bc15a5f61 * renamed a_param_* to a_load_*_cgpara
git-svn-id: trunk@15305 -
2010-05-22 09:07:21 +00:00
Jonas Maebe
b6e4896805 * small typo corrections by Adriaan Van Os (mantis #15652)
git-svn-id: trunk@14844 -
2010-02-02 10:41:38 +00:00
florian
5acf377e31 * enable node cse for all cpus as level 2 optimization
git-svn-id: trunk@14703 -
2010-01-17 12:28:28 +00:00
florian
515774b864 * merged armthum branch
-- Zusammenführen der Unterschiede zwischen Projektarchiv-URLs in ».«:
U    rtl/arm/setjump.inc
A    rtl/arm/thumb2.inc
U    rtl/arm/divide.inc
A    rtl/embedded/arm/stm32f103.pp
U    rtl/inc/system.inc
U    compiler/alpha/cgcpu.pas
U    compiler/sparc/cgcpu.pas
U    compiler/i386/cgcpu.pas
U    compiler/ncgld.pas
U    compiler/powerpc/cgcpu.pas
U    compiler/avr/cgcpu.pas
U    compiler/aggas.pas
U    compiler/powerpc64/cgcpu.pas
U    compiler/x86_64/cgcpu.pas
U    compiler/cgobj.pas
U    compiler/psystem.pas
U    compiler/aasmtai.pas
U    compiler/m68k/cgcpu.pas
U    compiler/ncgutil.pas
U    compiler/rautils.pas
U    compiler/arm/raarmgas.pas
U    compiler/arm/armatts.inc
U    compiler/arm/cgcpu.pas
U    compiler/arm/armins.dat
U    compiler/arm/rgcpu.pas
U    compiler/arm/cpubase.pas
U    compiler/arm/agarmgas.pas
U    compiler/arm/cpuinfo.pas
U    compiler/arm/armop.inc
U    compiler/arm/narmadd.pas
U    compiler/arm/aoptcpu.pas
U    compiler/arm/armatt.inc
U    compiler/arm/aasmcpu.pas
U    compiler/systems/t_embed.pas
U    compiler/psub.pas
U    compiler/options.pas

git-svn-id: trunk@13801 -
2009-10-04 09:03:44 +00:00
Jonas Maebe
34c985cfa6 * added register type parameter to cgsize2subreg(), as the subreg can
depend on that (and correct a number of cases where this was wrong)
  * set the correct subreg type for xmm x86_64 parameter registers
    (resolved mantis #14067)

git-svn-id: trunk@13410 -
2009-07-19 13:57:23 +00:00
Jonas Maebe
7d459cf12a * the compiler now explicitly keeps track of the minimally guaranteed
alignment for each memory reference (mantis #12137, and
    test/packages/fcl-registry/tregistry1.pp on sparc). This also
    enables better code generation for packed records in many cases.
  o several changes were made to the compiler to minimise the chances
    of accidentally forgetting to set the alignment of memory references
    in the future:
    - reference_reset*() now has an extra alignment parameter
    - location_reset() can now only be used for non LOC_(C)REFERENCE,
      use location_reset_ref() for those (split the tloc enum so the
      compiler can catch errors using range checking)

git-svn-id: trunk@12719 -
2009-02-08 13:00:24 +00:00
Jonas Maebe
a4cc881693 * fixed compilation after addition of support for weak symbols
git-svn-id: trunk@12716 -
2009-02-08 10:21:17 +00:00
Jonas Maebe
b1c3f76ff9 * changed the supported targets for assembler writers to a set, and
(hopefully correctly) limited all assembler writers to only the
    OSes they support (mantis #11801)

git-svn-id: trunk@12622 -
2009-01-28 15:12:43 +00:00
florian
1afb1aa9cc + ror/rol functions
+ internal compiler support for ror/rol on i386

git-svn-id: trunk@11466 -
2008-07-27 17:12:32 +00:00
yury
491f0fa1d8 * Replaced all user defined warnings by TODO comments to reduce compiler noise.
git-svn-id: trunk@11443 -
2008-07-23 11:00:03 +00:00
yury
b70bf05ad5 * I hope it's proper fix for r10688.
git-svn-id: trunk@10690 -
2008-04-18 10:51:56 +00:00
yury
e71d631c24 * Fix for tw10233 for all CPUs.
git-svn-id: trunk@10688 -
2008-04-18 07:38:25 +00:00
yury
771479e65c * Improved fix for bug #10233 for better Delphi compatibility and efficiency:
- Explicit typecasts like LongBool(byte_value) do not change ordinal value.
  - Explicit typecasts like ByteBool(longint_value) do not change ordinal value and can lead to data loss if longint_value is outside of ByteBool range.
  - Explicit typecasts like ByteBool(LongBool) handle type ranges correctly.
  - Updated test tw10233.pp. It is passed by Delphi as well.

git-svn-id: trunk@10672 -
2008-04-15 22:19:29 +00:00
yury
cf235145cb * Fixed a_load_reg_reg for arm.
* Fixed sign/zero-extension in second_int_to_bool for all CPUs. x86 and pppc were not affected by this bug, but I fixed it for all CPUs for consistency.
* cg/tcnvint1 is passed on arm now.

git-svn-id: trunk@10669 -
2008-04-15 20:44:27 +00:00
Jonas Maebe
62e66d2a56 * explicit typecasting of any ordinal type to a boolean of the same
size must happen without any mangling of the value (mantis #11027)
  * moved checking for signed-to-unsigned (or vice versa) type
    conversions in assignments from htypechk to ncnv (where there
    was already code for similar checks) and added support for
    bool_to_bool there as well

git-svn-id: trunk@10521 -
2008-03-21 14:44:58 +00:00
peter
8f239d04b6 * cleanup and simplify the set type handling
git-svn-id: trunk@10432 -
2008-03-02 17:48:27 +00:00
Jonas Maebe
8349cde7db * changed byte/word/longbool to be Delphi-compatible (+ similar changes
for qwordbool) + test:
    o assigning true to such a variable now sets them to $ff/$ffff/$ffffffff
    o these types are now all signed
    o converting an integer type to a byte/word/long/qwordbool using an
      explicit type cast keeps the integer's original value stored in the
      bool, instead of forcing it to ord(true)/ord(false)
    (mantis #10233 and #10613, implemented for all architectures, testsuite
     tested for ppc32, sparc and x86)
  * fixed some places where the rtl depended on longbool(true) having the
    value 1
  * extended several boolean tests (and adapted some to no longer assume
    that byte/word/long/qwordbool(true)=1)
  + support for converting to qwordbool in second_int_to_bool for x86, ppc
    and sparc

git-svn-id: trunk@9898 -
2008-01-24 21:30:55 +00:00
florian
94ea214f32 * more spilling fixes
git-svn-id: trunk@9820 -
2008-01-20 16:13:20 +00:00
florian
50294418bc * spilling for neg, ext and extb fixed
git-svn-id: trunk@9819 -
2008-01-20 16:07:42 +00:00
Jonas Maebe
18eb495d0f * give a regular error message instead of an internal error on x86
when using non-PIC references in assembler code when the compiler
    is configured to generate PIC code (on ppc, sparc and arm, no
    error message is given at all currently)

git-svn-id: trunk@9364 -
2007-12-01 11:28:15 +00:00
Károly Balogh
8674e35f45 * removed a_call_reg hack, not needed after peter's latest fix
git-svn-id: trunk@9130 -
2007-11-04 15:27:31 +00:00
Károly Balogh
14f958682c + first attempt to implement a_call_reg
+ various other changes

git-svn-id: trunk@9127 -
2007-11-04 01:40:02 +00:00
Károly Balogh
1536e9e65b + de-uglified the previous hack
+ made Amiga syscalls to save/restore the frame pointer (do we really need a frame pointer?)
 + some disabled debug comments (to asm source)
 + compiler is now able to generate some VERY basic, but working Amiga-m68k executables

git-svn-id: trunk@9051 -
2007-11-01 19:31:58 +00:00
Károly Balogh
12bcb539e6 + fix(?) stack return address with an ugly hack...
git-svn-id: trunk@9047 -
2007-11-01 16:04:16 +00:00
Károly Balogh
91abb3aeb9 + first (failed) attempt to have a working stackframe generation
git-svn-id: trunk@9040 -
2007-11-01 14:16:17 +00:00
Károly Balogh
b91c0756c4 + made m68k to compile system unit again
git-svn-id: trunk@9017 -
2007-10-31 22:33:00 +00:00
florian
00d6a03b2c + default code now preserves mm registers
* save|restore_standard_registers => save|restore_registers

git-svn-id: trunk@8954 -
2007-10-27 12:02:28 +00:00
florian
3a630340be * fixed m68k compilation and put it in fullcycle
git-svn-id: trunk@8953 -
2007-10-27 11:24:50 +00:00
peter
9f0ca44c94 * new tf_smartlink_library flag
* use create_smartlink[_sections|_library] to check what to 
    do for smartlinking

git-svn-id: trunk@8715 -
2007-10-01 16:55:08 +00:00
peter
6b8aed593f * remove registers{int/mmx/fpu} from firstpass
* small cleanups of unused variables in firstpass
  * node_resources_fpu() created to get an approximation of the
    required fpu registers
  * for the moment use node_complexity in the CG until the
    node_resource_int() is created

git-svn-id: trunk@8655 -
2007-09-26 21:12:01 +00:00
florian
bd4bb505b3 * put Charlie's writeln debugger between DEBUG_CHARLIE conditional compilation symbols
git-svn-id: trunk@8503 -
2007-09-16 11:43:04 +00:00
florian
abfdda6129 * small m68k cleanups
git-svn-id: trunk@8500 -
2007-09-16 10:21:17 +00:00
Károly Balogh
0c6f533ba3 + made m68k compiler to compile again
git-svn-id: trunk@8467 -
2007-09-13 22:30:27 +00:00
yury
3b7e458f02 * Properly set location of float return value if it is passed as var parameter (it is always happens for safecall functions). It fixes bugs #8523 and #8977.
+ test.

git-svn-id: trunk@7728 -
2007-06-18 23:23:46 +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
Jonas Maebe
e815b923d5 * a_loadfpu_* gets two size parameters: fromsize and tosize
* fixed downsizing the precision of floating point values
  * floating point constants are now treated using only the minimal
    precision required (e.g. 2.0 is now a single, 1.1 extended etc)
    (Delphi compatible)

git-svn-id: trunk@5927 -
2007-01-12 18:33:51 +00:00
Jonas Maebe
1d96dcc50d * renamed nf_swaped to nf_swapped
git-svn-id: trunk@5818 -
2007-01-05 12:47:22 +00:00
florian
d1b6522866 * fixed pushing of parameters on m68k
git-svn-id: trunk@5800 -
2007-01-03 21:46:49 +00:00
pierre
8bd9d88641 * remove C like code to be able to compile unit
git-svn-id: trunk@5794 -
2007-01-02 23:30:23 +00:00
Károly Balogh
abcf865224 + more a_param_* implemented
git-svn-id: trunk@5792 -
2007-01-02 22:11:52 +00:00
Jonas Maebe
a23fa2e81e * moved (unfinished) routines related to writing taicpu's to ppu files
from x86/aasmcpu to aasmtai and (new) aasmsym, so that when they're
    finished they're available for all targets
  * added dummy implementation of tai_cpu_abstract.pass1 and pass2 so there
    are no more hundreds of warnings on non-x86 about constructing taicpu
    instances with abstract methods

git-svn-id: trunk@5787 -
2007-01-02 18:28:05 +00:00
Károly Balogh
e5249a8b56 + some messy m68k changes (first attempt to implement a_param_*)
git-svn-id: trunk@5782 -
2007-01-02 00:11:52 +00:00
Károly Balogh
f4b44b8a97 + unbroke m68k-amiga syscalls
git-svn-id: trunk@5586 -
2006-12-13 20:19:43 +00:00
florian
6d2e5027b3 * preserve opsize
git-svn-id: trunk@5555 -
2006-12-07 20:42:59 +00:00
Károly Balogh
d6844efccc + fixed dbra errors
git-svn-id: trunk@5544 -
2006-12-05 19:03:20 +00:00
Jonas Maebe
05a07a7dd2 * better fix for previous revision
* also applied to x86 and m68k

git-svn-id: trunk@5512 -
2006-11-30 20:55:32 +00:00
Károly Balogh
119cdbb772 - fixed bra #.label assembler errors hopefully
git-svn-id: trunk@5492 -
2006-11-26 16:19:54 +00:00
florian
ab919747a6 * several m68k fixes
* push_value_para partially cleaned up

git-svn-id: trunk@5435 -
2006-11-20 22:13:49 +00:00
florian
2b7fb31a9e * return float values in fpu registers only in non emulation mode
git-svn-id: trunk@5429 -
2006-11-19 22:25:23 +00:00
peter
0557ddc342 * removed typed const, it is now handled by staticvarsym
* globalvarsym renamed to staticvarsym
  * fixed invalid regvar use in init when the finalize also uses the var

git-svn-id: trunk@5290 -
2006-11-08 21:04:22 +00:00
florian
4cbb67aa00 * some fpu emulation code from arm to generic code generator moved
* several m68k fixes

git-svn-id: trunk@5218 -
2006-11-04 10:23:35 +00:00
peter
4ea7562084 * compile fix
git-svn-id: trunk@5216 -
2006-11-04 00:31:39 +00:00
peter
658c46b903 * remove tdictionary and tindexarray
* symtables based on TFPHashObjectList and TFPObjectList
  * rename torddef.typ to torddef.ordtype
  * rename tfloatdef.typ to tfloatdef.floattype
  * rename tdef.deftype to tdef.typ
  * remove obsolete browser code, browcol is kept so the ide
    can still be compiled

git-svn-id: trunk@5192 -
2006-11-03 00:30:30 +00:00
peter
9eb07499bf * fix non-x86 for iasmop
git-svn-id: trunk@5151 -
2006-11-01 16:23:43 +00:00
peter
cb246eb781 * Remove dos,strings units, use SysUtils instead
* replace split* functions with Extract* functions
  * Add Directory caching

git-svn-id: trunk@5102 -
2006-10-30 23:29:35 +00:00
florian
85d63d9fa9 * settings refactored
git-svn-id: trunk@5094 -
2006-10-30 18:02:58 +00:00
peter
3078a1927f * remove ttype
* rename old ttype variables *type to *def
  * rename resulttypepass to pass_typecheck
  * rename pass_2 to pass_generate_code

git-svn-id: trunk@5077 -
2006-10-29 22:19:39 +00:00
florian
2a54d957b2 * fixed two small errors
* supported_optimizerswitches now takes generic flags also into account

git-svn-id: trunk@4865 -
2006-10-11 21:14:47 +00:00
florian
a61abb25cb * reorganized optimizer switch sets
git-svn-id: trunk@4862 -
2006-10-11 18:16:10 +00:00
Jonas Maebe
90cacb4cf5 * changed result type of dwarf_reg from byte to shortint to avoid
warning about comparison which can never be true

git-svn-id: trunk@4183 -
2006-07-14 17:25:16 +00:00
peter
0ec2921bbe * split newasmsymbol to refasmsymbol and defineasmsymbol
git-svn-id: trunk@3057 -
2006-03-27 11:45:18 +00:00
peter
870be04a3f * use dwarf_reg()
git-svn-id: trunk@3046 -
2006-03-26 20:15:32 +00:00
peter
37c81492ad Merged revisions 2827,2831,2837,2932-2980 via svnmerge from
svn+ssh://peter@www.freepascal.org/FPC/svn/fpc/branches/linker/compiler

r2827 (peter)
  * smartlinking of resourcestrings


r2831 (peter)
  * process_ea 64bit fixes


r2837 (peter)
  * linker script

git-svn-id: trunk@2981 -
2006-03-19 22:12:52 +00:00
Jonas Maebe
8a6ebdf274 - disabled loop unrolling for level 3 optimizations since it only causes
crashes (and even if it didn't, on its own it mainly causes code
    bloat)

git-svn-id: trunk@2941 -
2006-03-17 17:42:39 +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
peter
588cccb3ca * remove some obsolete i386 specific code
* use a_optimize_const to remove useless opcodes

git-svn-id: trunk@2910 -
2006-03-13 16:37:08 +00:00
peter
d8dc5679e3 * aktcputype and aktoptimizecputype was missing in the previous optimization commits
git-svn-id: trunk@2907 -
2006-03-13 12:29:56 +00:00
peter
2888a21593 * list supported optimization options in -i
* support $OPTIMIZATION and $O+

git-svn-id: trunk@2904 -
2006-03-13 11:17:56 +00:00
peter
b6e35a200e * rewrite of optimizer options
git-svn-id: trunk@2901 -
2006-03-13 09:05:50 +00:00
Károly Balogh
314e1672b7 + fixed m68k for latest changes
git-svn-id: trunk@2834 -
2006-03-10 14:23:08 +00:00
Károly Balogh
3b2fe2b622 * some more tiny m68k hacks...
git-svn-id: trunk@2804 -
2006-03-07 23:01:55 +00:00
Károly Balogh
e785aee0a1 + added ifndef NOTARGETAMIGA
git-svn-id: trunk@2404 -
2006-02-02 11:55:33 +00:00
peter
54d4e9e4b9 * palmos patch from mazen
git-svn-id: trunk@2400 -
2006-02-02 07:12:43 +00:00
Károly Balogh
a9dbab1035 - tiny bits of mess cleanup
git-svn-id: trunk@2399 -
2006-02-02 00:11:49 +00:00
florian
2c1e796f1f * fixed regallocator for m68k
git-svn-id: trunk@2395 -
2006-02-01 20:26:28 +00:00
Károly Balogh
9a879981ed * even more m68k mess
a tiny fix, and some code from ppc cg, to serve as base

git-svn-id: trunk@2391 -
2006-02-01 15:19:58 +00:00
Károly Balogh
37024dc4d0 + more m68k mess... ignore :)
git-svn-id: trunk@2384 -
2006-01-31 16:58:50 +00:00
Károly Balogh
8d8e9b8806 + more 68k mess, committed to transfer between dev machines, ignore
git-svn-id: trunk@2382 -
2006-01-31 01:39:24 +00:00
Károly Balogh
db07870443 totally messy m68k changes. cleanup in progress
git-svn-id: trunk@2352 -
2006-01-27 14:20:35 +00:00
peter
47c1bb60b4 * remove svn:executable from *.pp and *.pas
git-svn-id: trunk@1997 -
2005-12-20 08:11:59 +00:00
Károly Balogh
739ae4c254 + 1st attempt to have explicit funcretloc for Amiga/m68k
git-svn-id: trunk@1978 -
2005-12-18 03:58:27 +00:00
Károly Balogh
12b1ff0df2 + added n68kcal.pas, forgot to add previously
git-svn-id: trunk@1977 -
2005-12-17 16:44:31 +00:00
Károly Balogh
238964e443 Various m68k fixes/additions:
- fixes in asmreader, basic stuff works again, the rest is untested
  - removed lot of unnecessary ungetcpuregister()s
  - various other fixes i forgot
  + basic amigaos syscalls support. still lacks explicit funcretloc

git-svn-id: trunk@1943 -
2005-12-13 20:42:15 +00:00
florian
d7a5ca107b * fixed m68k compilation while sitting bored in the train
git-svn-id: trunk@1823 -
2005-11-25 23:08:46 +00:00
peter
1f8c074ab4 * make m68k compile
git-svn-id: trunk@1138 -
2005-09-19 11:46:23 +00:00
peter
a3ab2053c9 * support multiple asmlabel types, renamed getlabel to
getjumplabel and added type para to getlabel for specific types
  * moved lineinfo generation from assemble and aggas to dbgstabs

git-svn-id: trunk@1120 -
2005-09-18 21:16:10 +00:00
florian
804207239d *c <int64>:=-<longint> fixed (bug 4253)
git-svn-id: trunk@796 -
2005-08-05 19:00:30 +00:00
Károly Balogh
bbfea4d03f an attempt to fix a bit more stuff in m68k
git-svn-id: trunk@794 -
2005-08-04 21:28:25 +00:00
Károly Balogh
e7b1c386b7 some dirty 68k changes/experiments...
git-svn-id: trunk@792 -
2005-08-04 20:00:20 +00:00
Jonas Maebe
8bc4e0a32f * inline and compilerproc are now procoptions instead of proccall types
(so both can be combined with each other, as well as with other calling
     conventions)
  * defined COMPPROCINLINEFIXED so SYSTEMINLINE is again activated

git-svn-id: trunk@658 -
2005-07-18 15:27:14 +00:00
peter
4ace790492 * remove $Log
git-svn-id: trunk@231 -
2005-06-07 09:47:55 +00:00
Károly Balogh
94281c5589 few fixes and advancements. 68k cg now compiles empty system unit without crashing.
git-svn-id: trunk@224 -
2005-06-05 23:36:35 +00:00
Károly Balogh
62121a9029 made m68k to compile again
git-svn-id: trunk@212 -
2005-06-05 13:07:13 +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
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
peter
35e466d971 * remove copy_value_on_stack and a_param_copy_ref 2005-01-20 17:47:01 +00:00
peter
04c97cc129 * load jmp_buf_size from system unit 2005-01-20 16:38:45 +00:00
Károly Balogh
6bae9c8f6d * made m68k to compile again 2005-01-08 04:10:36 +00:00
florian
54ceea9e60 * some m68k stuff updated 2004-11-27 16:16:02 +00:00
peter
6c9c4c686c * small m68k updates to bring it up2date
* give better error for external local variable
2004-11-09 22:32:59 +00:00
peter
c95a859f0a * generic tlocation
* move tlocation to cgutils
2004-10-31 21:45:02 +00:00
peter
66df745917 * small regvar for para fixes
* function tvarsym.is_regvar added
  * tvarsym.getvaluesize removed, use getsize instead
2004-10-11 15:48:15 +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
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
florian
b5bf8cefad + <pointer> - <pointer> result is divided by the pointer element size now
this is delphi compatible as well as resulting in the expected result for p1+(p2-p1)
2004-05-20 21:54:33 +00:00
Károly Balogh
5b31a1c142 * added some basic code for later syscall support on M68k/Amiga 2004-05-12 13:28:01 +00:00
florian
2555cc8496 * register numbers for address registers fixed 2004-05-06 22:01:54 +00:00
florian
5168141540 * m68k compiler compilation fixed 2004-05-06 20:30:51 +00:00
florian
71f80e8bef * continued to fix m68k compiler compilation 2004-05-01 23:29:01 +00:00
florian
c68ea95074 + syscall directive support for MorphOS added 2004-04-28 15:19:03 +00:00
florian
c63660d3b9 * several updates for compilation 2004-04-27 15:46:01 +00:00
florian
842754a456 - removed offsetfixup reference 2004-04-27 15:00:37 +00:00
florian
9706934fdc * fixed using new reg. tables 2004-04-27 13:54:10 +00:00
florian
9e26b177e6 * initial revision 2004-04-27 05:43:42 +00:00
florian
b19572b41d + gas registers 2004-04-26 11:05:14 +00:00
florian
1f18d7ac1b * some m68k stuff fixed 2004-04-25 21:26:16 +00:00
florian
e750e24f3b * fixed compilation 2004-04-19 21:15:12 +00:00
florian
a702d678aa * more adaptions for m68k 2004-04-18 21:13:59 +00:00
olle
4fecc1a56f * big transformation of Tai_[const_]Symbol.Create[data]name* 2004-03-02 00:36:32 +00:00
peter
ecfbbeffc3 * renamed xNNbittype to xNNinttype
* renamed registers32 to registersint
  * replace some s32bit,u32bit with torddef([su]inttype).def.typ
2004-02-03 22:32:53 +00:00
florian
b80d10cb70 * fixed some m68k compilation problems 2004-01-30 12:17:18 +00:00
Károly Balogh
eec59028e3 * m68k register tables 2003-12-10 02:39:33 +00:00
Károly Balogh
4050f10698 * initial revision 2003-12-10 02:30:58 +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
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
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
d29c96896f * fixed newra cycle for x86
* added constants for indicating source and destination operands of the
    "move reg,reg" instruction to aasmcpu (and use those in rgobj)
2003-06-14 14:53:50 +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
daniel
41e0bc4cec * Register allocator finished 2003-06-03 13:01:59 +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
72ad478f97 * fix compile for ppc,sparc,m68k 2003-04-23 21:10:54 +00:00
peter
2bb32541be * fix m68k compile 2003-04-23 13:40:33 +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
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
daniel
86bcea6ef5 * Code generator converted to new register notation
- Horribily outdated todo.txt removed
2003-02-19 22:00:14 +00:00
carl
236a807071 * bugfix of emissions of jmp instructions 2003-02-15 22:19:40 +00:00
carl
3c97889b0f * some small m68k bugfixes 2003-02-12 22:11:13 +00:00
carl
59d3edeec7 * Several bugfixes for m68k target (register alloc., opcode emission)
+ VIS target
  + Generic add more complete (still not verified)
2003-02-02 19:25:54 +00:00
daniel
6e507ba483 * Added register conversion 2003-01-09 15:49:56 +00:00
daniel
55a161bbbf * Tregister changed into a record 2003-01-08 18:43:56 +00:00
florian
b59b436130 * x86-64 compiles
+ very basic support for float128 type (x86-64 only)
2003-01-05 13:36:53 +00:00
carl
3214bab118 * maxoperands -> max_operands (for portability in rautils.pas)
* fix some range-check errors with loadconst
  + add ncgadd unit to m68k
  * some bugfix of a_param_reg with LOC_CREFERENCE
2002-12-14 15:02:03 +00:00
florian
121ca40b39 * some variant <-> dyn. array stuff 2002-12-05 14:27:25 +00:00
carl
6413a958a5 * rename an error message 2002-12-01 22:12:36 +00:00
carl
62e2cd1c67 * merges from Pierre's fixes in m68k fixes branch 2002-11-30 23:33:02 +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
mazen
a835405a27 * fixed a compilation bug accmulator-->accumulator, in definition of return_result_reg 2002-11-17 18:26:15 +00:00
mazen
41153e2b1a + return_result_reg and function_result_reg are now used, in all plateforms, to pass functions result between called function and its caller. See the explanation of each one 2002-11-17 17:49:08 +00:00
carl
3e7b597352 + update for compilation 2002-11-09 16:10:35 +00:00
carl
de26052432 + flag_2_cond implemented 2002-10-14 16:32:36 +00:00
carl
4be0f8c217 + a_call_reg 2002-09-22 14:15:31 +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
carl
6e30bbfd42 + a_call_reg 2002-09-08 15:12:45 +00:00
carl
752beef0dd * cardinal -> longword 2002-09-07 20:40:23 +00:00
peter
dcd9e0107c * old logs removed and tabs fixed 2002-09-07 15:25:00 +00:00
daniel
fff92ef11e * Fixed PowerPC & M68000 compilation 2002-09-03 19:04: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
carl
63ed5b6f99 - remove some unused files in m68k directory 2002-08-19 18:19:06 +00:00
carl
ed77671a9b + optimize64_op_const_reg implemented (optimizes 64-bit constant opcodes)
* more fixes to m68k for 64-bit operations
2002-08-19 18:17:47 +00:00
florian
41eda73784 * fixed compilation problems 2002-08-18 09:02:12 +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
588abc6631 * jmpbuf size allocation for exceptions is now cpu specific (as it should)
* more generic nodes for maths
  * several fixes for better m68k support
2002-08-15 15:15:55 +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
carl
b0bf9a2512 * fix small compilation problem 2002-08-14 19:31:26 +00:00
carl
7866026667 + m68k type conversion nodes
+ started some mathematical nodes
  * out of bound references should now be handled correctly
2002-08-14 19:16:34 +00:00
Jonas Maebe
3ab3c91e0a - remove valuelow/valuehigh fields from tlocation, because they depend
on the endianess of the host operating system -> difficult to get
    right. Use lo/hi(location.valueqword) instead (remember to use
    valueqword and not value!!)
2002-08-14 18:41:47 +00:00
florian
af4302bc67 * more fixes for ppc calling conventions 2002-08-13 21:40:55 +00:00
carl
654ddac250 + m68k problems with cvs fixed?()! 2002-08-13 18:58:54 +00:00
carl
1edae761ef + m68k problems with cvs fixed?()! 2002-08-13 18:51:29 +00:00
carl
77346f3219 * rename swatoperands to swapoperands
+ m68k first compilable version (still needs a lot of testing):
      assembler generator, system information , inline
      assembler reader.
2002-08-13 18:45:32 +00:00
carl
a86c9a1c12 * rename swatoperands to swapoperands
+ m68k first compilable version (still needs a lot of testing):
      assembler generator, system information , inline
      assembler reader.
2002-08-13 18:30:22 +00:00
carl
c68b2dfbee * rename swatoperands to swapoperands
+ m68k first compilable version (still needs a lot of testing):
      assembler generator, system information , inline
      assembler reader.
2002-08-13 18:01:50 +00:00
carl
b0cb623e27 - removed and renamed 2002-08-13 17:35:10 +00:00
carl
9da171faf2 + stab register indexes for powerpc (moved from gdb to cpubase)
+ tprocessor enumeration moved to cpuinfo
  + linker in target_info is now a class
  * many many updates for m68k (will soon start to compile)
  - removed some ifdef or correct them for correct cpu
2002-08-12 15:08:39 +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
carl
a4d74cfd17 + try to commit this ** file again 2002-08-11 08:06:09 +00:00
carl
f94cec7ddb - removed unused m68k stuff 2002-08-09 19:21:50 +00:00
carl
f46268dbf6 + more m68k fixes 2002-08-06 15:14:30 +00:00
carl
834283b0ba + updated m68k 2002-08-05 17:26:09 +00:00
carl
5c6c9c0499 - remove no longer used files 2002-08-05 17:20:59 +00:00
carl
3034065498 + restart m68k support 2002-07-29 17:51:32 +00:00
carl
21b3a10f02 + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+ try to fix temp allocation (still in ifdef)
+ generic constructor calls
+ start of tassembler / tmodulebase class cleanup
2002-05-16 19:46:34 +00:00
carl
9b12acc70a * renamed some constants 2002-04-20 21:38:45 +00:00
florian
ac4bbd85f0 * renamed 2000-11-30 22:41:55 +00:00
florian
d1f882fd59 * moved to m68k 2000-11-30 22:22:50 +00:00
peter
d93a445b58 * moved into m68k subdir 2000-11-30 20:30:33 +00:00
michael
e7aca136a1 + Initial import 2000-07-13 06:29:38 +00:00
peter
e525797c51 * updated copyright to 2000 2000-01-07 01:14:18 +00:00
florian
a0badc3a30 * initial revision 1999-09-17 09:59:19 +00:00
florian
fbbf8a505c * m68k compiler is again compilable (only gas writer, no assembler reader) 1999-09-16 23:05:51 +00:00