Commit Graph

56 Commits

Author SHA1 Message Date
florian
70a836c4a2 * first part of merging parts of Jeppe's intrinsics patch, mainly r31135
is merged by this commit with a lot of adaptions

git-svn-id: trunk@43949 -
2020-01-14 21:52:39 +00:00
Jonas Maebe
9630eb7ce9 * synchronised with trunk till r40466
git-svn-id: branches/debug_eh@40467 -
2018-12-04 19:54:31 +00:00
Jonas Maebe
122d0d36d6 + volatile() expression that marks an expression as volatile
* disable matching volatile references in the assembler optimisers, so they
    can't be removed (more conservative than needed, but better than removing
    too many)
   o the CSE optimiser will ignore them by default, because they're an unknown
     inline node for it
  * also removed no longer used fpc_in_move_x and fpc_in_fillchar_x inline node
    identifiers from rtl/inc/innr.inc, and placed fpc_in_unaligned_x at the
    right place

git-svn-id: trunk@40465 -
2018-12-04 19:53:20 +00:00
Jonas Maebe
8555ec1438 + fpc_eh_return_data_regno() intrinsic to get the return register numbers
for the Dwarf EH exception handler result

git-svn-id: branches/debug_eh@40070 -
2018-10-28 18:16:38 +00:00
nickysn
78e0f6c68b + added an i8086-specific FarAddr() function, similar to Addr(), but always
returns a far pointer, regardless of the current memory model

git-svn-id: trunk@37628 -
2017-11-27 16:41:48 +00:00
florian
c7d5525b56 + implemented some AVR specific intrinsics
git-svn-id: trunk@37544 -
2017-11-01 16:33:34 +00:00
nickysn
f514657e45 + implemented the sar/shl/shr/rol/ror inline modify-in-place nodes; the actual
optimization of "i:=i shl/shr k", etc statements is not performed yet

git-svn-id: trunk@35780 -
2017-04-12 00:41:15 +00:00
nickysn
256dc546ac + implemented the in_neg_assign_x and in_not_assign_x inline nodes, which will
be used (TBD in a future commit) for optimizing x:=-x and x:=not x on CPUs
  that support performing these operations directly in memory (such as x86)

git-svn-id: trunk@35749 -
2017-04-07 16:02:40 +00:00
nickysn
fc59649a98 + added inline nodes for handling and/or/xor in place (i.e. x:=x op y, where
op=and/or/xor). They generate more optimal code on certain architectures
  (including x86). The new inline nodes aren't generated by the compiler yet,
  but will be used in the future, at certain optimization levels, whenever the
  pattern x:=x op y is detected by the compiler.

git-svn-id: trunk@35666 -
2017-03-26 23:16:53 +00:00
florian
9c81e90e08 + extension to iso mode: reset/rewrite can take a file name as a second parameter
git-svn-id: trunk@34726 -
2016-10-16 07:55:08 +00:00
svenbarth
fd66d70449 innr.inc:
+ add constants for the Delete and Insert intrinsics
compproc.inc:
  * use the new constants instead of magic values to denote the relationship of the compilerprocs to the intrinsics

git-svn-id: trunk@33901 -
2016-06-04 08:58:38 +00:00
Jonas Maebe
ff583bde6c * made setstring() a compiler intrinsic so it can set the compile-time
code page of ansistrings (mantis #26735)

git-svn-id: trunk@28813 -
2014-10-12 20:27:06 +00:00
Jonas Maebe
d9c13d892e + added fpc_in_aligned forgotten in r23310
git-svn-id: trunk@28812 -
2014-10-12 20:27:04 +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
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
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
d6966e545b + support for formal var/out parameters on the JVM target:
o primitive types are first boxed
   o the parameter is passed inside an array of one class instance
   o changing the parameter inside the routine (by assigning a value to it
     like in Delphi.NET and different from regular Pascal code) will replace
     this class instance (again boxing the value if required)
   o on return, the class instance is extracted, unboxed if required, and
     assigned back to the original location
   o formal const parameters are handled without the extra array indirection,
     since they cannot be changed

  TODO: while writing tjvmcallparanode.handleformalcopyoutpara() I forgot that
    calling getcopy on ttemprefnodes whose ttempcreatenode hasn't been copied
    yet works fine, so that code is more complex than needed. Still have to
    fix.

git-svn-id: branches/jvmbackend@18675 -
2011-08-20 08:23:33 +00:00
florian
5dae691c96 * implementation of bit scan intrinsics by Richard Vida, resolves #17592
git-svn-id: trunk@16174 -
2010-10-16 15:03:30 +00:00
florian
dfc2652062 + support of compiler intrinsic sar* using a patch by Benjamin Rosseaux, resolves #15606
git-svn-id: trunk@14834 -
2010-01-31 16:47:01 +00:00
Jonas Maebe
5885866990 + support for objcencode() (equivalent of Objective-C's @encode()) + test
+ functionality to encode Objective-C function signatures (untested)

git-svn-id: branches/objc@13557 -
2009-08-18 19:54:02 +00:00
Jonas Maebe
becdecc5e4 * part of r13461
git-svn-id: branches/objc@13466 -
2009-07-26 22:52:45 +00:00
Jonas Maebe
6165536b5e + added {$modeswitch objectivec1}/-Mobjectivec1 mode switch to enable
the use of Objective-C 1.0 constructs. Because it is a mode switch, it
    can be used cumulatively with every syntax mode. Note that a {$mode xxx}
    statement resets all mode switches as well, so you cannot use the
    -Mobjectivec1 variant if you have such a statement in a unit. This
    modeswitch is currently only enabled for Darwin/PowerPC and Darwin/i386,
    as the backend support is not yet implemented for other platforms.
  + implemented selector() statement that can be used to create an Objective-C
    selector for the message with the specified *constant* name (in the future,
    it will also work for Objective-C method identifiers)
  + added SEL type to the system unit (the selector() statement returns it)
  + added all Objective-C segments to the assembler writers
  + (currently mostly dummy) objc1 unit that is automatically included if the
    {$modeswitch objectivec1} statement is used
  + some tests for the selector() statement

git-svn-id: trunk@12870 -
2009-03-08 18:40:32 +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
florian
fb8bbd5ff0 + inline abs(<longint>) on x86
git-svn-id: trunk@9333 -
2007-11-25 18:54:40 +00:00
Jonas Maebe
c80d4225ca + support for ISO Extended Pascal ReadStr() and WriteStr() routines
git-svn-id: trunk@7333 -
2007-05-14 17:34:01 +00:00
Jonas Maebe
cd5b9245f9 + support for bitsizeof() function
+ some small tests for it

git-svn-id: trunk@4590 -
2006-09-09 18:57:49 +00:00
Jonas Maebe
eccbc78e04 + support for bitpacked arrays:
+ use {$bitpacking on/+} to change the meaning of "packed"
      into "bitpacked" for arrays. This is the default for MacPas.
      You can also define individual arrays as "bitpacked", but
      this is not encouraged since this keyword is not known by
      other compilers and therefore makes your code unportable.
    + pack(unpackedarray,index,packedarray) to pack
      length(packedarray) elements starting at
      unpackedarray[index] into packedarray.
    + unpack(packedarray,unpackedarray,index) to unpack
      packedarray into unpackedarray, with the first
      element being stored at unpackedarray[index]
  * todo:
    * "open packed arrays" and rtti for packed arrays are not
      yet supported
    * gdb does not properly support bitpacked arrays

git-svn-id: trunk@4449 -
2006-08-19 12:54:12 +00:00
daniel
fea15be56f * Prepare for internal stack frame functions.
git-svn-id: trunk@3511 -
2006-05-13 20:57:37 +00:00
peter
2d3c01d83a * basic work to make Move() and FillChar() internal under ifdef INTERNALMOVEFILLCHAR
git-svn-id: trunk@3021 -
2006-03-24 17:32:39 +00:00
Jonas Maebe
9455dea30b + slice constant
git-svn-id: trunk@2651 -
2006-02-20 10:59:42 +00:00
michael
3a2eaa94b1 + Removed INTERNCONSTINTF define
git-svn-id: trunk@267 -
2005-06-07 22:04:18 +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
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
peter
4d8460ec2f * float routines all use internproc and compilerproc helpers 2004-11-21 15:35:23 +00:00
peter
14eb8f59b4 internconst, internproc and some external declarations moved to interface 2004-11-17 22:19:04 +00:00
olle
7793f8aa27 * updated according to compiler/compinnr.inc 2004-07-05 21:59:18 +00:00
florian
6cd2cddd33 + added prefetch(const mem) 2004-02-02 20:39:27 +00:00
peter
ef708fdab9 * Swap(QWord) constant support 2002-11-18 18:33:51 +00:00
peter
01dfac4a4e * old logs removed and tabs fixed 2002-09-07 15:06:34 +00:00
florian
4d5f0c2331 + in_typeinfo_x added 2000-07-19 20:03:19 +00:00
michael
650fbb86aa + removed logs 2000-07-13 11:32:24 +00:00
michael
e7aca136a1 + Initial import 2000-07-13 06:29:38 +00:00
peter
6b66a55cd6 * truncated log 2000-02-09 16:59:28 +00:00
daniel
ec29a31834 * copyright 2000 2000-01-07 16:41:28 +00:00
daniel
a79b4a404b * copyright 2000 added 2000-01-07 16:32:21 +00:00
florian
af80c87ba9 + constants for math functions 1999-09-15 20:23:16 +00:00
florian
01aceb4f07 + qword/int64: lo/hi/swap 1999-07-02 18:06:40 +00:00
peter
dc1f9b5bbb * addr() internal 1999-04-17 13:10:23 +00:00