Commit Graph

564 Commits

Author SHA1 Message Date
florian
4d148382dc * patch from Ludo Brands: remove po_inline artefact from ancient inlining code in sparc parameter handling, resolves #20397
git-svn-id: trunk@19396 -
2011-10-06 18:39:40 +00:00
florian
b270a1922b * reverts r18960, should solve sparc trouble
git-svn-id: trunk@19017 -
2011-09-07 18:33:22 +00:00
florian
b17a9385e5 * use generic first_int_to_real 64 bit values on sparc
* compile part of softfpu into the system unit as consequence of using the generic first_int_to_real

git-svn-id: trunk@18961 -
2011-09-03 19:58:32 +00:00
florian
1de4d16eea - remove ncpucall for sparc, it has no use anymore
git-svn-id: trunk@18960 -
2011-09-03 19:46:13 +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
b023627f6a * converted tcgcasenode.pass_generate_code() to hlcgobj
o changed type of opsize field of tcgcasenode from tcgsize into tdef,
     and fixed compilation of other code generator units after this change

git-svn-id: branches/jvmbackend@18339 -
2011-08-20 07:48:33 +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
ff5f311b34 - removed no more used constants
git-svn-id: trunk@18199 -
2011-08-13 20:54:01 +00:00
pierre
32d919f543 Use ptruint type in typecast to avoid warning
git-svn-id: trunk@17872 -
2011-06-29 15:05:30 +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
sergei
7d99f95c45 * Always create a section before emitting data to current_asmdata.asmlists[al_typedconsts]. Without it, such data ends up in sections created elsewhere, creating very non-obvious dependencies on other parts of compiler.
git-svn-id: trunk@17816 -
2011-06-24 02:05:56 +00:00
sergei
9608c4eabe * Interface wrappers must be global when linking smart, Mantis #19462. Other targets already have this condition in place.
git-svn-id: trunk@17631 -
2011-06-02 10:49:28 +00:00
florian
bf32e47132 * hopefully fixes broken sparc-solaris building due to r17459
git-svn-id: trunk@17522 -
2011-05-22 08:17:03 +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
Jonas Maebe
f302fcdc98 + TSubRegisterSet definition forgotten to commit in r15952
* fixed compilation on non-x86 platforms after r15952

git-svn-id: trunk@15956 -
2010-09-09 08:48:02 +00:00
Jonas Maebe
57bd6d2685 + merged nestedprocvars branch
+ support for nested procedural variables:
    o activate using {$modeswitch nestedprocvars} (compatible with all
      regular syntax modes, enabled by default for MacPas mode)
    o activating this mode switch changes the way the frame pointer is
      passed to nested routines into the same way that Delphi uses (always
      passed via the stack, and if necessary removed from the stack by
      the caller) -- Todo: possibly also allow using this parameter
      passing convention without enabling nested procvars, maybe even
      by default in Delphi mode, see mantis #9432
    o both global and nested routines can be passed to/assigned to a
      nested procvar (and called via them). Note that converting global
      *procvars* to nested procvars is intentionally not supported, so
      that this functionality can also be implemented via compile-time
      generated trampolines if necessary (e.g. for LLVM or CIL backends
      as long as they don't support the aforementioned parameter passing
      convention)
    o a nested procvar can both be declared using a Mac/ISO Pascal style
      "inline" type declaration as a parameter type, or as a stand-alone
      type (in the latter case, add "is nested" at the end in analogy to
      "of object" for method pointers -- note that using variables of
      such a type is dangerous, because if you call them once the enclosing
      stack frame no longer exists on the stack, the results are
      undefined; this is however allowed for Metaware Pascal compatibility)

git-svn-id: trunk@15694 -
2010-08-02 22:20:36 +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
0d57bba4c9 * fixed ARM and MIPS compilation after r14912
git-svn-id: trunk@14923 -
2010-02-18 21:19:17 +00:00
pierre
fdc3e9dd6f * Fix special register numbers
git-svn-id: trunk@14812 -
2010-01-27 12:27:03 +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
pierre
04f0544570 * fix stabs/dwarf register numbers for GDB
git-svn-id: trunk@14460 -
2009-12-21 18:16:19 +00:00
pierre
ca6eabd55d * fi for tw10831 test failure on sparc solaris
git-svn-id: trunk@14453 -
2009-12-20 09:17:36 +00:00
Jonas Maebe
b30b7ee6b1 * fixed alignment initialisation of temprary dst reference in
g_concatcopy_unaligned()

git-svn-id: trunk@14287 -
2009-11-29 15:14:56 +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
cc5aeb09de * fixed handling the result value of functions where the result type is
forced to something else by the compiler (internal rtl functions etc),
    necessary for the objc branch
  * fixed adding all used function result registers to the list of
    registers that may need to be saved before a function call

git-svn-id: trunk@13695 -
2009-09-12 12:21:34 +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
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
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
Jonas Maebe
a23630260b + "weakexternal" support for imported procedures and variables.
the syntax is exactly the same as for "external", except for
    the keyword. It is currently only active for Darwin targets.
    It should also work at least for Linux targets, but only with
    the GNU assembler (which is why it is not activated there)
  + test for this functionality

git-svn-id: trunk@12009 -
2008-11-01 18:38:32 +00:00
Jonas Maebe
4d58c33fb0 * fixed int64 to boolean conversion for loc_(c)reference based on ppc code
git-svn-id: trunk@11866 -
2008-10-07 15:36:05 +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
florian
5c18145632 * fix interface wrappers on sparc
git-svn-id: trunk@10999 -
2008-05-18 11:11:30 +00:00
florian
77e5e0525c * experimental sparc interface wrapper patch
git-svn-id: trunk@10991 -
2008-05-17 20:10:35 +00:00
mazen
dec0ba97b0 * Applied patch to fix issue with far call for sparc (bug #11312).
git-svn-id: trunk@10988 -
2008-05-17 19:31:08 +00:00
Jonas Maebe
263984f874 * fixed a_load_ref_reg for OS_S8->OS_16 for ppc32, ppc64 and sparc
(and on ppc64 also for OS_S8->OS_32 and OS_S16->OS_32)
  * adapted tcnvint6 to check for ppc64 OS_S16->OS_32 conversion
    (the old comparison was performed using a 32 bit compare and
     therefore did not notice the wrong result)

git-svn-id: trunk@10705 -
2008-04-18 20:04:55 +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
f36e5411af * split cpu64bit compiler define into
a) cpu64bitaddr, which means that we are generating a compiler which
       will generate code for targets with a 64 bit address space/abi
    b) cpu64bitalu, which means that we are generating a compiler which
       will generate code for a cpu with support for 64 bit integer
       operations (possibly running in a 32 bit address space, depending
       on the cpu64bitaddr define)
   All cpus which had cpu64bit set now have both the above defines set,
   and none of the 32 bit cpus have cpu64bitalu set (and none will
   compile with it currently)
  + pint and puint types, similar to aint/aword (not pword because that
    that conflicts with pword=^word)
  * several changes from aint/aword to pint/pword
  * some changes of tcgsize2size[OS_INT] to sizeof(pint)

git-svn-id: trunk@10320 -
2008-02-13 20:44:00 +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
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
Jonas Maebe
ad5ce1adf4 * fixed a_load_reg_ref: the store size has to depend on the tosize,
not on the fromsize (fixes webtbs/tw10072, and hopefully also
    resolves mantis #8121)

git-svn-id: trunk@9037 -
2007-11-01 13:31:23 +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
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
Jonas Maebe
4f7106eded * sparc compiles again
git-svn-id: trunk@8495 -
2007-09-16 09:14:21 +00:00
Jonas Maebe
d64eb811ab * fixed compilation after r8349
git-svn-id: trunk@8491 -
2007-09-15 07:21:56 +00:00
Jonas Maebe
e205481027 * fixed sparc bootstrap
* use -Av9 assembler option so it accepts the memory barrier opcodes

git-svn-id: trunk@8244 -
2007-08-08 09:48:37 +00:00
micha
d95b9082bb * add memory barrier prototypes + implementation for i386 and sparc + use lwsync for powerpc64
git-svn-id: trunk@8240 -
2007-08-07 20:37:08 +00:00
Jonas Maebe
20dbda751a * fixed sparc compilation after addr_lo/hi changes
git-svn-id: trunk@8107 -
2007-07-20 12:30:16 +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
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
Jonas Maebe
683de5ada2 * don't destroy source register when performing division of signed
number by constant power of two

git-svn-id: trunk@7431 -
2007-05-23 14:05:27 +00:00
Jonas Maebe
085689af60 + support for unaligned stores
* avoid some unnecessary unaligned load sequences

git-svn-id: trunk@7427 -
2007-05-23 12:03:42 +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
2b0c01b903 * simplified and fixed a_load_reg_reg()
git-svn-id: trunk@7121 -
2007-04-17 13:35:42 +00:00
peter
d810064e48 * fix shift for 16bit from mazen
git-svn-id: trunk@7091 -
2007-04-12 09:58:21 +00:00
peter
1f7cde0306 * patch from mazen to fix zero extending of register moves where the destination
size is larger than the source size

git-svn-id: trunk@7090 -
2007-04-12 07:11:24 +00:00
florian
070874461c * fix for tcnvint5 on sparc
git-svn-id: trunk@7088 -
2007-04-11 19:38:04 +00:00
florian
9140766d5a * support for unaligned loads/stores on sparc
git-svn-id: trunk@7062 -
2007-04-05 12:49:12 +00:00
florian
53b2b1e882 * several packed array and varset related ies on sparc fixed
git-svn-id: trunk@6899 -
2007-03-17 09:16:48 +00:00
Jonas Maebe
c866400823 + support for VMTOFFSET in assembler readers to get VMT offset of virtual
methods (mantis #8153)

git-svn-id: trunk@6168 -
2007-01-24 18:26:23 +00:00
Jonas Maebe
302a2a3ec2 * fixed calling qualified methods in assembler + tests for ppc/ppc64/
i386/x86_64

git-svn-id: trunk@6112 -
2007-01-21 22:16:42 +00:00
florian
2fabc692fa * fixed memory leaks
* cleaned up some stuff

git-svn-id: trunk@6025 -
2007-01-17 14:00:36 +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
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
Jonas Maebe
87e7e435bf * store parameters at the callee side with the required alignment
git-svn-id: trunk@5604 -
2006-12-15 10:37:26 +00:00
florian
abcccc2f03 * memory leaking fixed
git-svn-id: trunk@5566 -
2006-12-11 12:23:52 +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
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
florian
e8d5dc4ab2 * tailrecursion optimization enabled for for sparc, i386, x86-64 and arm
git-svn-id: trunk@4860 -
2006-10-11 16:34:28 +00:00
Jonas Maebe
2000c7d3e3 * used "gas" instead of "as" for Solaris (both sparc and x86)
and not for linux/sparc

git-svn-id: trunk@4659 -
2006-09-19 13:38:44 +00:00
Jonas Maebe
805570c3cf * fixed internalerrors due to no (dummy) MM reg allocator
git-svn-id: trunk@4336 -
2006-08-03 15:37:26 +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
5376d2d570 Merged revisions 3072-3073 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/linker/compiler

........
r3072 | peter | 2006-03-29 13:34:42 +0200 (Wed, 29 Mar 2006) | 4 lines

  * std_regname generate pair of registers for float doubles
  * don't call translate_register for regvars if -sr is passed
  * use std_regname in regalloc message

........
r3073 | peter | 2006-03-29 16:00:37 +0200 (Wed, 29 Mar 2006) | 2 lines

  * CMP instructions only read operands

........

git-svn-id: trunk@3079 -
2006-03-30 06:36:42 +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
florian
46a68c8a27 * fixed compilation
git-svn-id: trunk@2945 -
2006-03-17 21:01:50 +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
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
florian
558c894e73 * fix for dword div dword power of two
git-svn-id: trunk@2890 -
2006-03-12 18:22:11 +00:00
Jonas Maebe
9de2847865 + support for passing parameters via pre-allocated stack space on i386
(override/adjust cgutils.use_fixed_stack to change conditions where
     this is done, currently only activated for darwin-i386)
  * make sure the stack is always aligned to 16 bytes on darwin-i386

git-svn-id: trunk@2840 -
2006-03-10 19:59:44 +00:00
Jonas Maebe
ba6f1e4990 * factered WriteInstruction out of TGNUAssembler into its own class
* put Apple-specific GNU assembler stuff in its own class
  + darwin/x86 support to the assembler writer

git-svn-id: trunk@2818 -
2006-03-09 14:59:04 +00:00
florian
0b1b0047f4 * use GNU Assembler by default on sparc-solaris, it's now called gas
git-svn-id: trunk@2510 -
2006-02-10 19:06:28 +00:00
florian
68016e4db2 * fixed function result handling for procedure which are inlinable
git-svn-id: trunk@2461 -
2006-02-06 21:44:35 +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
peter
ca66b9f7c1 * force writing of new section before generating the jumptable
git-svn-id: trunk@1085 -
2005-09-15 14:08:02 +00:00
peter
fdc4925fcd * basic framework for debuginfo class added
git-svn-id: trunk@1084 -
2005-09-15 08:34:51 +00:00
peter
c3727c29b2 * rename al_code to al_procedures, al_bss/al_data to al_globals
* more work for section smartlinking

git-svn-id: trunk@1083 -
2005-09-15 06:51:12 +00:00
peter
05a628447f * put typedconsts in own asmlist to prevent mixing
array and string data
  * added al_rodata
  * renamed tasmlist enum names to include al_ prefix

git-svn-id: trunk@899 -
2005-08-17 08:42:52 +00:00
florian
9be5247db5 * dyn. arrays are always passed by value, fixes 4240
git-svn-id: trunk@800 -
2005-08-05 21:52:58 +00:00
florian
804207239d *c <int64>:=-<longint> fixed (bug 4253)
git-svn-id: trunk@796 -
2005-08-05 19:00:30 +00:00
daniel
d05f58b604 * Group asmlists into array to be able to add
some of them more comfortably.
  * x86_64 compilation was broken, fixed.
  * Sparc compilation was broken, fixed.

git-svn-id: trunk@731 -
2005-07-23 13:44:32 +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
c1b2e1aac5 * check function/procedure type when adding a proc definition
git-svn-id: trunk@546 -
2005-06-30 14:56:05 +00:00
florian
88392fa21d * cardinal to double fixed
git-svn-id: trunk@514 -
2005-06-28 19:31:29 +00:00
florian
1fa6d8c993 * syntax error fixed
git-svn-id: trunk@410 -
2005-06-14 21:01:42 +00:00
peter
4ace790492 * remove $Log
git-svn-id: trunk@231 -
2005-06-07 09:47:55 +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
Jonas Maebe
ec959955bd * fixed generic jumps optimizer and enabled it for ppc (the label table
was not being initialised -> getfinaldestination always failed, which
    caused wrong optimizations in some cases)
  * changed the inverse_cond into a function, because tasmcond is a record
    on ppc
  + added a compare_conditions() function for the same reason
2005-02-26 01:26:59 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
florian
22d9294ab3 + overflow checking for the arm 2005-02-13 18:55:19 +00:00
florian
651f9e5bbd + implemented overflow checking for 64 bit types on sparc 2005-01-27 20:32:51 +00:00
florian
4efb72e13d * fixed load64 which shouldn't do a make_simple_ref 2005-01-25 20:58:30 +00:00
peter
e820bc93f2 * interface wrapper generation moved to cgobj
* generate interface wrappers after the module is parsed
2005-01-24 22:08:32 +00:00
florian
00324d38bf + optimized code generation on sparc
+ some stuff for pic code on sparc added
2005-01-23 17:14:21 +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
Jonas Maebe
9c22d594b0 + support for passing records in registers under darwin
* tcgpara now also has an intsize field, which contains the size in
    bytes of the whole parameter
2005-01-10 21:50:05 +00:00
florian
fcfbc935a1 + implemented abi compliant handling of strucutured functions results on sparc platform 2005-01-07 16:22:54 +00:00
florian
ed57ad0371 * improved code generation for OP_MUL/OP_IMUL 2005-01-01 13:19:09 +00:00
florian
b44f17099c * fixed some alignment trouble 2004-12-18 15:48:06 +00:00
florian
d018160981 * fixed compilation 2004-12-04 15:23:00 +00:00
peter
8cf8c54609 * fixed varargs
* replaced dynarray with tlist
2004-11-22 22:01:19 +00:00
peter
a29eab36c7 * fixed funcretloc for sparc 2004-11-21 18:13:31 +00:00
peter
89b1b583c9 * ttempcreatenode.create_reg merged into .create with parameter
whether a register is allowed
  * funcret_paraloc renamed to funcretloc
2004-11-21 17:54:59 +00:00
florian
18f7aa97dd * changed funcret location back to tlocation 2004-11-21 17:17:03 +00:00
peter
4d8460ec2f * float routines all use internproc and compilerproc helpers 2004-11-21 15:35:23 +00:00
peter
e740a66636 * tparaitem removed, use tparavarsym instead
* parameter order is now calculated from paranr value in tparavarsym
2004-11-15 23:35:30 +00:00
peter
0c7e53bb81 * fixed compile of powerpc,sparc,arm 2004-11-11 19:31:33 +00:00
florian
239db4ba9d * marked o* registers as volatile 2004-11-07 00:33:45 +00:00
peter
c95a859f0a * generic tlocation
* move tlocation to cgutils
2004-10-31 21:45:02 +00:00
florian
a684d2669d * fixed jump table for sparc 2004-10-31 14:24:47 +00:00
florian
3a06b4f0fd * jmp table code generation for case statement on sparc 2004-10-30 22:01:11 +00:00
florian
7eccede56f * initial revision, not yet enabled 2004-10-30 17:50:53 +00:00
florian
e04b172854 * fixed generic optimizer
* enabled generic optimizer for sparc
2004-10-30 15:21:37 +00:00
peter
5ec6609d11 * add saved_standard_registers 2004-10-25 17:04:51 +00:00
peter
705868e816 * remove saveregister calling convention 2004-10-24 20:01:08 +00:00
florian
410d01458c * fixed several arm compiler bugs 2004-10-24 17:32:53 +00:00
peter
2ee2004032 * fixed compilation with removed loadref 2004-10-24 11:53:45 +00:00
florian
39805b678a * fixed currency to float conversion 2004-10-15 22:54:53 +00:00
peter
d6bffaf5c6 * fixed sparc compile
* fixed float regvar loading
2004-10-10 20:51:46 +00:00
peter
434475be33 * concatcopy_unaligned maps by default to concatcopy, sparc will
override it with call to fpc_move
2004-10-10 20:31:48 +00:00
florian
30873fc9a8 * fixed generation of refs wiht large offsets, code still broken though 2004-10-05 21:29:29 +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
florian
d57089732b * fixed dword->single/double on sparc 2004-10-03 19:21:56 +00:00
florian
001292bf50 * made sqrt, sqr and abs internal for the sparc 2004-10-03 12:41:30 +00:00
peter
75cd5c80fa * indents 2004-10-01 17:33:47 +00:00
florian
15d3388449 * fixed more sparc overflow stuff
* fixed some op64 stuff for sparc
2004-09-29 18:55:40 +00:00
peter
0af84db9cf * fixed crash 2004-09-28 20:19:36 +00:00
peter
6da9996dba * fixed passing of flaot parameters. The general size is still float,
only the size of the locations is now OS_32
2004-09-27 21:24:17 +00:00
peter
25b0dc04d7 * fixed spilling code 2004-09-27 21:23:26 +00:00
florian
62f93d3473 + partial overflow checking on sparc; multiplication still missing 2004-09-26 21:04:35 +00:00
florian
5392f62678 + a_jmp_name for sparc added 2004-09-26 17:36:12 +00:00
florian
be3f78e283 * handling of C styled varargs fixed 2004-09-25 20:28:39 +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
d5140a5792 * don't remove MOV reg1,reg1 it is needed for the RA 2004-09-21 20:33:00 +00:00
peter
33a834821f * paraloc branch merged 2004-09-21 17:25:12 +00:00
florian
5b2a1d9fdf * fixed absolute on sparc 2004-08-25 20:40:04 +00:00
florian
1eb575fa22 * fixed longbool(<int64>) on sparc 2004-08-24 21:02:32 +00:00
florian
59a814d7e1 * fixed boolean(<int>) on sparc 2004-08-23 20:45:52 +00:00
florian
4b3ed28d07 * morphos now takes any pointer var. as libbase
* alignment for sparc fixed
  * int -> double conversion on sparc fixed
2004-08-22 20:11:38 +00:00
peter
f3f33a5fea * fixed shr/shl 32 2004-08-16 21:00:30 +00:00
florian
cf25a973f8 * fixed alignment of variant records
* more alignment problems fixed
2004-08-15 13:30:18 +00:00
florian
6368652be2 * fixed several sparc alignment issues
+ Jonas' inline node patch; non functional yet
2004-08-14 14:50:42 +00:00
florian
6802705043 * float to float and int to float fixed 2004-08-01 19:01:10 +00:00
florian
8eaf31e212 * qword/int64 shifting fixed 2004-08-01 08:46:31 +00:00
mazen
72556ae39f * fix compile problem 2004-07-26 04:00:35 +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
cf6f4fb550 - offsetfixup removed 2004-06-20 07:11:32 +00:00
florian
588e2c38bf * dwarf branch merged 2004-06-16 20:07:06 +00:00
florian
c68ea95074 + syscall directive support for MorphOS added 2004-04-28 15:19:03 +00:00
mazen
5962aeb34e * make sparc para manager quite similar to ppc one to help
copying evolutions.
+ Add support to var args in registers. need to be verfied as it
  was just copying ppc's one
2004-03-15 14:39:56 +00:00
mazen
5d851cb954 + support for LongBool(Int64) type cast 2004-03-15 14:37:06 +00:00
mazen
6f13b5d5f3 * fixed conditions upon IEs for inlined function call stack frames 2004-03-12 15:42:18 +00:00
mazen
e465aa443e - revert '../' from include path 2004-03-12 08:18:11 +00:00
mazen
9fe655fa0f + help lazarus analyze the file 2004-03-11 16:21:27 +00:00
mazen
8fade03fa5 + give location for 64bit to fix IE 200402061 2004-03-09 13:05:49 +00:00
mazen
7ba73ec7b0 * make it as similar to PPC one ase possible 2004-03-08 16:28:39 +00:00
olle
4fecc1a56f * big transformation of Tai_[const_]Symbol.Create[data]name* 2004-03-02 00:36:32 +00:00
mazen
83d619bec5 * symaddr ==> refaddr to follow the rest of compiler changes 2004-02-27 15:15:33 +00:00
mazen
f02d3cfc4f * symaddr ==> refaddr to follow the rest of compiler changes 2004-02-27 13:27:28 +00:00
mazen
46c23fdc4d + added AInt support 2004-02-27 11:44:48 +00:00
mazen
b1bffd0a95 * symaddr ==> refaddr to follow the rest of compiler changes 2004-02-27 11:43:56 +00:00
florian
fabb9c33ac * top_symbol killed
+ refaddr to treference added
  + refsymbol to treference added
  * top_local stuff moved to an extra record to save memory
  + aint introduced
  * tppufile.get/putint64/aint implemented
2004-02-27 10:21:04 +00:00
mazen
77473fed86 * fix compile problem for sparc 2004-02-25 14:25:47 +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
Jonas Maebe
9495f77117 - removed taicpu.is_reg_move because it's not used anymore
+ support tracking fpu register moves by rgobj for the ppc
2004-02-08 20:15:42 +00:00
peter
8c5b0f7d82 * first try to get cpupara working for x86_64 2004-02-04 22:01:13 +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
mazen
bf36516f33 * Supported assembler modes are GAS and STANDARD 2004-01-26 14:41:24 +00:00