Commit Graph

82 Commits

Author SHA1 Message Date
florian
8207e0ef22 + make use of vfnmsub*/vfmsub*/vfnmadd* instructions if possible
git-svn-id: trunk@27721 -
2014-05-02 21:07:46 +00:00
florian
33602db802 * try to registers more cleverly during fma code generation
git-svn-id: trunk@27671 -
2014-04-26 18:11:13 +00:00
florian
18233f2c0c * fix compilation of i8086 compiler
git-svn-id: trunk@27566 -
2014-04-13 19:28:59 +00:00
florian
d88d644925 + support for FMA intrinsic: if there is no hardware support, the compiler throws an error.
Currently it is implemented only for x86-CPUs supporting the FMA extension. While it would
  be possible to implement it in software or simulate fma(<single>,<single>,<single>) using
  double operations, it makes no sense in my opinion to do so.

git-svn-id: trunk@27564 -
2014-04-13 19:21:54 +00:00
Jonas Maebe
d452686c39 * moved pbestrealtype from symdef to symcpu
git-svn-id: trunk@27441 -
2014-04-01 21:41:37 +00:00
Jonas Maebe
6b16c05a98 * fixed compilation for i8086 with 2.6.x (it gave an unreachable code
warning)

git-svn-id: trunk@27358 -
2014-03-29 22:31:43 +00:00
sergei
e4819e863b + Consider target_info.cprefix in symbol names.
git-svn-id: trunk@27315 -
2014-03-28 09:07:58 +00:00
Jonas Maebe
4065483a50 * completed thlcgobj.location_force_fpureg(), use it everywhere and removed
ncgutil/thlcg2ll.location_force_fpureg()

git-svn-id: trunk@27071 -
2014-03-10 09:01:05 +00:00
florian
c00d752813 + create avx code in abs as well
* improved abs code generation with sse(2)

git-svn-id: trunk@26838 -
2014-02-22 15:35:14 +00:00
florian
1882ab8d5a * i8086 has no cpu_capabilites
git-svn-id: trunk@26791 -
2014-02-16 08:27:29 +00:00
florian
84f7f5f934 * popcnt has a separate cpuid flag so we should separate it from sse
git-svn-id: trunk@26789 -
2014-02-16 08:27:24 +00:00
nickysn
a7b4953795 + proper (i.e. not broken) implementation of arctan() for the 8087 and 80287
git-svn-id: trunk@26226 -
2013-12-12 23:46:51 +00:00
nickysn
09a3fc74e3 * use the fwait prefixed FSTCW, followed by FWAIT, instead of FNSTCW in
tx86inlinenode.second_trunc_real, when generating code for the 8087

git-svn-id: trunk@26186 -
2013-12-05 23:33:33 +00:00
sergei
bca2c464da * Don't generate x87 instructions for sin and cos on win64, somehow managed to not commit this part in r25995. Mantis #17273.
git-svn-id: trunk@26094 -
2013-11-15 10:37:59 +00:00
sergei
2b1e5f7014 * Mantis #17273: don't generate x87 instructions on win64 target.
git-svn-id: trunk@25995 -
2013-11-08 13:31:07 +00:00
sergei
486a7ef81e * tx86inlinenode.second_popcnt: use emit_ref_reg instead of appending instruction directly, this provides proper PIC handling of the reference. emit_reg_reg part is not strictly necessary, but done for consistency.
git-svn-id: trunk@25878 -
2013-10-28 16:40:42 +00:00
florian
fc72490166 * handle LOC_*FPUREGISTER correctly when using sse2 sqr, resolve #26408
git-svn-id: trunk@24909 -
2013-06-16 18:48:08 +00:00
florian
e81d2d1f3b * basic avx support for floating point operations (use -Cfavx to activate)
git-svn-id: trunk@24896 -
2013-06-14 20:03:01 +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
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
2b583bb265 * do not use fsin and fcos on 286-, since they're 387+
git-svn-id: trunk@24596 -
2013-05-25 15:24:53 +00:00
nickysn
09249b31b8 * use the generic implementation of second_IncludeExclude in case the cpu is earlier than 386, since then it does not support BTR and BTS
git-svn-id: trunk@24593 -
2013-05-25 14:18:55 +00:00
nickysn
9f0c23bd4c * fixed round() on i8086 after r24502
git-svn-id: trunk@24503 -
2013-05-15 00:45:08 +00:00
nickysn
3665ed4b03 + enabled returning int64 in ax:bx:cx:dx for the i8086
git-svn-id: trunk@24502 -
2013-05-14 22:45:57 +00:00
nickysn
3152df6e7f * fixed bugs in tx86inlinenode, introduced in r24237
git-svn-id: branches/i8086@24243 -
2013-04-14 16:16:47 +00:00
nickysn
97ca0fa323 - removed ti8086inlinenode.second_round_real, second_trunc_real and load_fpu_location as they mostly repeat the code in tx86inlinenode.load_fpu_location; tx86inlinenode.load_fpu_location adapted for i8086 instead
git-svn-id: branches/i8086@24237 -
2013-04-14 14:25:22 +00:00
nickysn
44ef72e1a4 * use the generic implementation of abs for the i8086
git-svn-id: branches/i8086@24004 -
2013-03-25 21:43:47 +00:00
nickysn
8d75441b6e * do not generate prefetchnt instructions on the i8086
git-svn-id: branches/i8086@24003 -
2013-03-25 19:18:18 +00:00
florian
10dbdb5c9a * fix compilation on x86-64
git-svn-id: trunk@22294 -
2012-09-03 09:52:06 +00:00
florian
76bea5c4fd * x86-64 and i386 use the popcnt instruction of possible
git-svn-id: trunk@22291 -
2012-09-02 20:59:48 +00:00
florian
ff12d63248 + generic popcnt support
git-svn-id: trunk@22290 -
2012-09-02 20:59:44 +00:00
florian
b782918434 * first draft to support the popcnt instruction, works so far for x86 with a real popcnt instruction
git-svn-id: trunk@22289 -
2012-09-02 20:59:39 +00:00
Jonas Maebe
bb28a7cd08 * decrease the fpu stack position counter after explicitly inserted
fist(t)pq instructions (mantis #22331)
  * also internalerror in case the internal fpu stack position counter
    becomes larger than 7, so we don't have to wait for the entire
    byte to overflow before we detect a problem

git-svn-id: trunk@21734 -
2012-06-29 09:52:35 +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
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
yury
92ad06f1e8 * Always use RIP relative symbol addressing for x86_64 Windows targets. Bug #13657.
* Support for simple form of RIP relative addressing by x86_64 assembler writer. Example: movl rax,SomeSymbol(%rip)

git-svn-id: trunk@13135 -
2009-05-13 10:07:44 +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
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
3d2630c661 * fixed wrong location.size (sign) for x86's in_abs_long + test
git-svn-id: trunk@10850 -
2008-05-01 11:47: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
ea22e81374 * fixed include/exclude for byte-sized sets in registers
git-svn-id: trunk@9887 -
2008-01-23 22:28:12 +00:00
peter
f0e804beb7 * typecast fix
git-svn-id: trunk@9349 -
2007-11-29 21:15:08 +00:00
florian
fb8bbd5ff0 + inline abs(<longint>) on x86
git-svn-id: trunk@9333 -
2007-11-25 18:54:40 +00:00
florian
9d88b1d9ef * x86-64 fixed
git-svn-id: trunk@8963 -
2007-10-28 08:45:48 +00:00
florian
f32831c44a * fixed assembling of fisttp of sse3 instruction set
+ sse3 optimized trunc() using fisttp
+ -Cfsse3 for x86-64

git-svn-id: trunk@8962 -
2007-10-27 20:50:46 +00:00
peter
9715eceee7 * fixed expectloc setting for x86_64
git-svn-id: trunk@8704 -
2007-09-30 21:02:33 +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
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
26a4f693da * more packed set operand size problems fixed (include/exclude, mantis
#9167)

git-svn-id: trunk@7833 -
2007-06-27 19:50:09 +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