Commit Graph

68 Commits

Author SHA1 Message Date
nickysn
90ecd72286 * x86_64 compilation fixed after r24752
git-svn-id: trunk@24755 -
2013-06-01 22:38:07 +00:00
nickysn
ec76b2cf40 * refactored the segment-in-integer-register reference support, so it's handled in make_simple_ref, instead of all over the place in the code generator
git-svn-id: trunk@24752 -
2013-06-01 22:18:09 +00:00
Jonas Maebe
2dd75e707e * renamed thlcgobj.tcgsize2orddef to defutil.cgsize_orddef
git-svn-id: trunk@24743 -
2013-06-01 18:28:15 +00:00
nickysn
525246f61b * support i8086 far references in tx86addnode.emit_op_right_left
git-svn-id: trunk@24737 -
2013-06-01 17:51:58 +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
nickysn
4c95592e08 * don't use 'fnstsw ax' if the current cpu level is below 286
git-svn-id: trunk@24401 -
2013-05-01 15:42:02 +00:00
nickysn
e6c8ac6694 * use the generic tcgaddnode.second_addsmallset on i8086, because the BTx instructions are 386+
git-svn-id: branches/i8086@23895 -
2013-03-17 15:40:54 +00:00
florian
6345aee80b * revert r19643: FloatToStr has to handle Nan correctly and should not cause
any exceptions (silent or not), FloatToStr has been fixed in r19783

git-svn-id: trunk@22877 -
2012-10-29 22:00:42 +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
pierre
85862e476b Fix for test tw19368
git-svn-id: trunk@19643 -
2011-11-16 22:04:28 +00:00
florian
46cc0209de * make use of mulps/mulpd and haddps/haddpd/hsubpd/hsubps to optimze x*x+y*y and x*x-y*y where x and y might be single or double
git-svn-id: trunk@18790 -
2011-08-20 12:34:37 +00:00
Jonas Maebe
44178f41b6 * don't overwrite register variables when evaluating <=/>= expressions with
smallsets (left is overwritten by an "and", so it cannot be const; mantis
    #18013)

git-svn-id: trunk@16400 -
2010-11-22 12:58:08 +00:00
Jonas Maebe
fff903a00b * fixed some unnecessary moving of values from cregister to register
after r7831

git-svn-id: trunk@15502 -
2010-06-30 19:53:15 +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
Jonas Maebe
53e52ac6a9 * implementation of 32x32->64 multiplication for i386 based on patch
by Sergei Gorelkin

git-svn-id: trunk@12028 -
2008-11-06 21:03:10 +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
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
6c536dab3e * added several missing make_simple_ref() calls
* removed addr_pic again for darwin, as you have to explicitly code
    the relative address using a relsym instead of using an assembler
    directive like @GOT there

git-svn-id: trunk@9353 -
2007-11-29 22:06:14 +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
peter
67e16340be * revert r8118
git-svn-id: trunk@8139 -
2007-07-22 19:59:00 +00:00
daniel
21293f5818 + Add common type integer promotion.
- {$intpromotion common_type} or -CIcommon_type switches to common type promotion.
    - {$intpromotion native_integer} or -CIcommon_type switches to current behaviour.
    - Default in tp mode is common_type, native_integer in other modes
    - Compiler can cycle with -CIcommon_type
    - Still needs checking on other architectures than i386

git-svn-id: trunk@8118 -
2007-07-21 19:16:24 +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
c43855a8f7 * Improve comment for [0..31]-x optimization
git-svn-id: trunk@7177 -
2007-04-27 13:35:25 +00:00
daniel
ea79e69176 + Add optimization to optimize [0..31]-x set expression to use one less
register. This construction is used in our Shootout meteor contest
    implementation.

git-svn-id: trunk@7176 -
2007-04-26 21:48:18 +00:00
Jonas Maebe
5f169f97ff * fixed SSE2 substraction when both operands are on the 80x87 fpu stack
git-svn-id: trunk@6959 -
2007-03-23 00:21:46 +00:00
Jonas Maebe
cdb67cfc8b * fixed bug with set comparisons after r6172
git-svn-id: trunk@6181 -
2007-01-24 22:28:25 +00:00
florian
2579cd139f + support for sets with size 1 and 2
git-svn-id: trunk@6172 -
2007-01-24 20:06:56 +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
a4a54a105d * fixed sse float substraction in case of swapped operands
git-svn-id: trunk@5817 -
2007-01-05 12:37:14 +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
6845c1e05a + subsetref support
git-svn-id: trunk@4492 -
2006-08-23 17:59:02 +00:00
Jonas Maebe
502556bd46 + subsetreg support
git-svn-id: trunk@4059 -
2006-07-02 08:07:10 +00:00
florian
6ef3a158e6 * fixed code generation for <word>+<word> saturated
git-svn-id: trunk@3969 -
2006-06-26 19:43:35 +00:00
florian
6ed96fd8ad * fixed compilation
git-svn-id: trunk@3887 -
2006-06-17 21:33:08 +00:00
florian
6ffe481799 * fixed sse addition if operands were swapped and in float registers
git-svn-id: trunk@3885 -
2006-06-17 19:43:15 +00:00
florian
a8c2419d8a * fixed left_and_right_must_be_fpureg
git-svn-id: trunk@3129 -
2006-04-02 20:36:20 +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
eb725d4e44 Merged revisions 2908,2911,2913-2917 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/linker/compiler

........
r2908 | peter | 2006-03-13 13:35:48 +0100 (Mon, 13 Mar 2006) | 2 lines

  * merge trunk upto r2907

........
r2911 | peter | 2006-03-13 18:08:00 +0100 (Mon, 13 Mar 2006) | 2 lines

  * rename values to make room for operand size codes

........
........
........
r2915 | peter | 2006-03-14 13:51:35 +0100 (Tue, 14 Mar 2006) | 2 lines

  * check aktcputype

........
r2916 | peter | 2006-03-14 15:06:32 +0100 (Tue, 14 Mar 2006) | 3 lines

  * merge 300 opcodes
  * more 64bit versions of opcodes

........
r2917 | peter | 2006-03-14 17:34:03 +0100 (Tue, 14 Mar 2006) | 3 lines

  * x86_64 tables
  * convert movq with normal registers to mov

........

git-svn-id: trunk@2931 -
2006-03-16 08:09:28 +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
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
florian
dac1050c11 + mmx support revived, fixes bug #4106
git-svn-id: trunk@555 -
2005-07-02 11:53:51 +00:00
florian
ebcb69478f * fixed a lot of stuff for fpu/mm register variables
git-svn-id: trunk@199 -
2005-06-04 21:23:15 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00