Commit Graph

57 Commits

Author SHA1 Message Date
nickysn
1797c8b803 * i8086 fixes for the handling of large sets in tx86innode.pass_generate_code; test/cg/tin.pp works now
git-svn-id: trunk@24634 -
2013-05-30 10:16:05 +00:00
nickysn
de345ac191 * added missing setbase fixup in tx86innode.pass_generate_code for the case of LOC_CONSTANT in LOC_REFERENCE for large sets
git-svn-id: trunk@24619 -
2013-05-26 10:53:42 +00:00
nickysn
533bd30094 * some more i8086 bug fixes in tx86innode.pass_generate_code
git-svn-id: trunk@24618 -
2013-05-26 09:08:28 +00:00
nickysn
967e10ea95 * i8086 fixes in tx86innode.pass_generate_code
git-svn-id: trunk@24617 -
2013-05-25 22:46:50 +00:00
nickysn
1f5d384a1e * i8086 fix in tx86casenode.genlinearlist
git-svn-id: branches/i8086@23990 -
2013-03-24 23:03:06 +00:00
nickysn
b930c9a0db * all the remaining cases of the 'in' operator fixed (hopefully) for i8086
git-svn-id: branches/i8086@23905 -
2013-03-17 20:38:44 +00:00
nickysn
8ca0b443b8 * another case of the 'in' operator fixed for i8086 ('x in const', when use_small=false and genjumps=false)
git-svn-id: branches/i8086@23903 -
2013-03-17 20:18:57 +00:00
nickysn
d7c9603351 * i8086 fixes for the 'in' operator in the case of 'unsigned,small,non_constant IN smallset'
git-svn-id: branches/i8086@23901 -
2013-03-17 17:40:15 +00:00
florian
d6f0a1a0df * do not generate scaled indicies for case table jumps for i8086
git-svn-id: branches/i8086@23872 -
2013-03-16 19:52:53 +00:00
florian
feefcb6d3d * don't generate dec for case nodes of unsigned types because dec does not set the carry flag, resolves #23503
git-svn-id: trunk@23229 -
2012-12-27 19:35:58 +00:00
florian
0b30b0fd5a * re-enable jump tables for x86-64, they are fixed, see also
http://www.hu.freepascal.org/lists/fpc-devel/2012-June/029141.html

git-svn-id: trunk@22921 -
2012-11-03 22:14:45 +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
sergei
c6d382fe18 * Moved procedure genlinearlist from ti386casenode to tx86casenode. This optimization works well on x86_64, resulting in approximately twice less instructions than when using generic code.
git-svn-id: trunk@19363 -
2011-10-04 11:48:33 +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
8b0301409a + i386/iphonesim target for the new iPhoneSimulator in Xcode 3.2.4 and
later: the same as i386/darwin, except
      a) uses the non-fragile Objective-C ABI/runtime
      b) does not require stubs for direct calls/jumps (not required for
         i386/darwin under 10.6 and later either, but still generated
         there for backwards compatibility)
      c) only the same packages are enabled as for ARM/Darwin
      d) MacOSAll is compiled specifically for the iPhoneSimulator SDK
    This target also defines the symbol "darwin" apart from the target
    name "iphonesim" for source code compatibility reasons.

git-svn-id: trunk@16065 -
2010-09-29 21:56:47 +00:00
Jonas Maebe
c6d00a2b1f * correct the register size holding a smallset < 4 bytes when using "bt"
on it (mantis #16861)
  * fixed some indentation

git-svn-id: trunk@15531 -
2010-07-07 18:45:57 +00:00
Jonas Maebe
dd55947b4b - disabled jump tables for x86_64, because they cause various kinds of
crashes with dynamic libraries (mantis #13628 and related bugs)

git-svn-id: trunk@13073 -
2009-05-01 14:54:38 +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
0197192441 * disabled jump tables for darwin/x86_64 for now since they don't work
there yet

git-svn-id: trunk@11502 -
2008-08-02 12:23:34 +00:00
florian
d05d315aa5 * jump table is written to the data segment so create a proper label for it, resolves #11735
git-svn-id: trunk@11477 -
2008-07-28 18:09:34 +00:00
yury
cf7390ea81 * Fixed 'mixed signed/unsigned' and pointer conversion warnings.
git-svn-id: trunk@11439 -
2008-07-23 09:36:07 +00:00
florian
a15d8778d6 + create jump tables for case statements on x86-64
git-svn-id: trunk@11377 -
2008-07-13 10:26:25 +00:00
peter
8f239d04b6 * cleanup and simplify the set type handling
git-svn-id: trunk@10432 -
2008-03-02 17:48:27 +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
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
e23a8655e8 * fixed generic in-code in case left = LOC_JUMP
* fixed generic and x86 in-code in case genjumps=true and
    complexity(right)>complexity(left) (not sure if possible
    in practice currently, but better safe than sorry)

git-svn-id: trunk@7912 -
2007-07-01 19:35:22 +00:00
Jonas Maebe
8caad93eaf * fixed several problems with packed set operand sizes
* added LOC_CONSTANT to the list of allowed locations for the left
    hand side of an in-node, so it doesn't get forced into a register
    anymore in that case

git-svn-id: trunk@7831 -
2007-06-27 17:26:18 +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
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
Jonas Maebe
1863fb4c55 * make more use of location_force_register in in-code, should fix
cycle on x86-64

git-svn-id: trunk@6376 -
2007-02-08 14:14:32 +00:00
Jonas Maebe
21cef2cdb1 * r6372 for x86(-64)
git-svn-id: trunk@6373 -
2007-02-07 23:10:54 +00:00
Jonas Maebe
f38d29cfab * optimized previous patch for "byte in set" (Thorsten Engler)
* fixed storing/loading of setdefs to/from ppu + test (Thorsten Engler)
  * fixed ppudump for new setdef format in ppus

git-svn-id: trunk@6363 -
2007-02-07 20:22:29 +00:00
Jonas Maebe
fc3852e59a * in non-TP modes, 'ord_larger_than_256 in set' now always returns
false instead of triggering a range error (mantis #8258,
    based on patch provided by Thorsten Engler)

git-svn-id: trunk@6357 -
2007-02-07 18:57:19 +00:00
Jonas Maebe
1d96dcc50d * renamed nf_swaped to nf_swapped
git-svn-id: trunk@5818 -
2007-01-05 12:47:22 +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
Jonas Maebe
b9f32e1828 * use expectloc instead of location.loc in pass1
git-svn-id: trunk@4594 -
2006-09-09 22:06:46 +00:00
Jonas Maebe
1a8c2f405d * fixed for subsetref/subsetreg
git-svn-id: trunk@4578 -
2006-09-09 09:31:14 +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
b6e35a200e * rewrite of optimizer options
git-svn-id: trunk@2901 -
2006-03-13 09:05:50 +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
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
c95a859f0a * generic tlocation
* move tlocation to cgutils
2004-10-31 21:45:02 +00:00