Commit Graph

104 Commits

Author SHA1 Message Date
florian
bbece3e668 * MIPS64 can
* MIPS64 does not need separate 64 bit code path for ordinals
2022-02-08 23:08:32 +01:00
florian
637976e83f * patch by Marģers to unify internal error numbers, resolves #37888
git-svn-id: trunk@47103 -
2020-10-13 19:59:01 +00:00
Jonas Maebe
ce598c15ec * factored out the conditions under which add nodes need to perform
overflow checks
   o in particular ensure that cpu-specific overrides don't perform overflow
     checks when nf_internal is set

git-svn-id: trunk@42573 -
2019-08-03 12:19:50 +00:00
Jonas Maebe
04d295f186 * first step towards supporting 32 bit targets with the LLVM code generator:
use the generic code in more cases when cpuhighleveltarget is defined

git-svn-id: trunk@41133 -
2019-01-29 21:39:09 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
florian
6d6a45c034 * add/sub nodes with nf_internal set should not do overflow checking, resolves #30889
* do not convert succ/pred into add/sub nodes if nf_internal is set

git-svn-id: trunk@34896 -
2016-11-13 21:18:39 +00:00
Jonas Maebe
da696057ab * converted register_maybe_adjust_setbase() to the high level code generator
git-svn-id: trunk@32591 -
2015-12-05 18:03:37 +00:00
yury
432248cbf1 * Removed lot of unused vars.
git-svn-id: trunk@31732 -
2015-09-17 12:48:58 +00:00
Jonas Maebe
555319ec15 - disabled x86-specific code when using llvm
git-svn-id: trunk@31686 -
2015-09-15 11:51:29 +00:00
Jonas Maebe
0fc1fd6ac1 * replaced current_procinfo.currtrue/falselabel with storing the true/false
labels of LOC_JUMP in the node's location. This generates some extra jumps
    for short circuit boolean and/or-expressions if optimizations are off, but
    with optimisations enabled the generated code is the same (except for JVM
    because the jump threading optimisation isn't enabled there yet).

git-svn-id: trunk@31431 -
2015-08-27 18:28:57 +00:00
Jonas Maebe
511e878606 * fixed pointer plus/minus integer on llvm (since a_op_* only gets a single
def, we have to ensure that both arguments have in fact the same type)

git-svn-id: branches/hlcgllvm@30108 -
2015-03-05 22:45:32 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
sergei
d72478eb64 * Function tjvmaddnode.cmpnode2topcmp is, in fact, not specific to any target. Moved it to generic tcgaddnode and reused in tmipsaddnode, where the same functionality was implemented in different way.
git-svn-id: trunk@26151 -
2013-11-28 11:52:47 +00:00
florian
ce9398f8d8 * do not reuse register on x86 either
git-svn-id: trunk@25911 -
2013-11-01 20:08:30 +00:00
florian
0a84f1f10c + avx uses add to multiply by 2
* formatting

git-svn-id: trunk@24906 -
2013-06-15 21:18:40 +00:00
Jonas Maebe
5051453806 + support for LOC_(C)MMREGISTER in hlcg
o migrated location_force_mmregister_scalar from ncgutil to hlcgobj

git-svn-id: trunk@24661 -
2013-05-31 12:05:14 +00:00
florian
d2aa35e9de * throw an internal error if code generation depends on expectloc but expectloc and real loc do not match
git-svn-id: trunk@22073 -
2012-08-13 15:02:55 +00:00
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
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
1bb9a3b3d7 * fixed generic code for subtracting one set from another if both are
in registers, because the left set could be overwritten before its
    last use

git-svn-id: trunk@18792 -
2011-08-20 20:36:13 +00:00
Jonas Maebe
d3a4866cf5 * reorder processing of left/right for add nodes somewhat to make
it easier for the register allocator/optimizer to reduce the
    number of intermediate stores to the stack

git-svn-id: branches/jvmbackend@18341 -
2011-08-20 07:48:42 +00:00
Jonas Maebe
e4d322bcdb + default implementation for for the *_checkoverflow() methods in case
setflags is false
  * don't call the *_checkoverflow() methods from ncgadd with setflags
    = true in case cs_check_overflow is disabled

git-svn-id: branches/jvmbackend@18314 -
2011-08-20 07:38:01 +00:00
Jonas Maebe
2cb4514c07 * converted all non-x86-specific and non-32bit-specific code to use hlcgobj
git-svn-id: branches/jvmbackend@18281 -
2011-08-20 07:21:21 +00:00
Jonas Maebe
6748a9a238 * fixed forcing setelementn on the correct side in add nodes
(pass_left_right() can switch the sides, so putting it in the
     correct location before calling that method is useless)

git-svn-id: trunk@18254 -
2011-08-17 20:12:47 +00:00
florian
990add9272 * fixed non short boolean evaluation of <64 bit bool> and/or <64 bit bool> on non-64 bit cpus
* extended test for new pas boolean types

git-svn-id: branches/pasboolxx@17841 -
2011-06-26 21:01:59 +00:00
florian
f5694da7bc * OS_INT => OS_32
git-svn-id: branches/avr@17108 -
2011-03-09 19:47:10 +00:00
Jonas Maebe
e8871f0885 * fixed and simplified tcgaddnode.second_addsmallset: don't modify
right.register for subn, because it may be constant

git-svn-id: trunk@16663 -
2010-12-30 14:55:57 +00:00
Jonas Maebe
0e96a159c8 * enabled pushing (x87) fpu registers in case too few might be available
also for x86_64, since some of those platforms also support the x87
    (noticed by Florian)

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

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

git-svn-id: trunk@14317 -
2009-12-03 22:46:30 +00:00
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
fee257ba81 * one more fix for x86 fpu stack swapping (mantis #10757)
git-svn-id: trunk@10199 -
2008-02-03 22:49:06 +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
0cbcf95ff2 * fixed compilation on non-x86 after r8617
git-svn-id: trunk@8628 -
2007-09-23 21:21:17 +00:00
florian
4cd15058df * take care of the used fpu instruction set when saving/restoring function results on x86
git-svn-id: trunk@8617 -
2007-09-23 14:23:31 +00:00
Jonas Maebe
89ed91509a * Some fixes for r8515:
* fixed set add-nodes in case left and right are swapped (taddset4)
   * fixed "in" expressions with packed sets in case left is < setbase
     (now tested by tw8258b, which was missing a {$packset 1} directive)

git-svn-id: trunk@8519 -
2007-09-16 22:24:42 +00:00
Jonas Maebe
0040eecf9f + support for extra packing of sets whose lower element number
is <> 0 (Delphi compatible now, + various tests)
  + support for enums and sets in is_in_limit()
  * fixed converting smallset expressions to varsets
  * improved choosing an appropriate common set type when mixing
    set types in an expression
  - removed no longer used normalset code from nadd.pas
  - disabled large set (>256 elements) support for now, because
    they are not yet supported entirely throughout the compiler
    and this causes errors at run time in several situations

git-svn-id: trunk@8515 -
2007-09-16 20:04:45 +00:00
Jonas Maebe
5cf2511283 - removed/disabled all normalset code (except for bootstrapping), since
it's no longer needed

git-svn-id: trunk@7403 -
2007-05-20 11:19:36 +00:00
Jonas Maebe
a0b57eddb5 * new internal set format for big endian systems. Advantages:
* varsets ({$packset x}) are now supported on big endian targets
    * gdb now displays sets properly on big endian systems
    * cleanup of generic set code (in, include/exclude, helpers), all
      based on "bitpacked array[] of 0..1" now
  * there are no helpers available yet to convert sets from the old to
    the new format, because the set format will change again slightly
    in the near future (so that e.g. a set of 24..31 will be stored in
    1 byte), and creating two classes of set conversion helpers would
    confuse things (i.e., it's not recommended to use trunk currently for
    programs  which load sets stored to disk by big endian programs compiled
    by previous FPC versions)
  * cross-endian compiling has been tested and still works, but one case
    is not supported: compiling a compiler for a different endianess
    using a starting compiler from before the current revision (so first
    cycle natively, and then use the newly created compiler to create a
    cross-compiler)

git-svn-id: trunk@7395 -
2007-05-19 17:15:15 +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
peter
5a68a743fc * remove invalid aword typecast
git-svn-id: trunk@6131 -
2007-01-22 19:40:31 +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
d0b6292137 * disable overflow checking when performing pointer arithmetic
(mantis 8049)

git-svn-id: trunk@5822 -
2007-01-05 21:52:31 +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
7781e842fc * varset support fixed
git-svn-id: trunk@5294 -
2006-11-08 22:48:44 +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
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
fb5e396881 + experimental -Sv option to support vector arithmetics
git-svn-id: trunk@4825 -
2006-10-07 21:39:48 +00:00
Jonas Maebe
6997121c18 * also perform "SSA" for certain loads (currently derefn, righthand side of
assignmentn and callparan), reduces number of long lived conflicts.
    Mainly helpful on register-starved cpus such as i386.

git-svn-id: trunk@4606 -
2006-09-10 16:21:50 +00:00