Commit Graph

474 Commits

Author SHA1 Message Date
Jeppe Johansen
c20b27ede9 Add most SSE instructions as intrinsics.
git-svn-id: trunk@44274 -
2020-03-06 21:34:22 +00:00
florian
3947922fea * set nf_* correctly when an inc/dec node is converted into an add/sub node
* do not firstpass during dead store removal as it disturbes the for each calls

git-svn-id: trunk@44180 -
2020-02-15 13:53:16 +00:00
Jonas Maebe
b625afe800 * never inline routines that call get_frame (otherwise get_frame would return
the frame of the caller rather than of the current routine, which could
    cause e.g. stackframes to be missed in RTL helpers that are known to be
    only called from run time error routines)

git-svn-id: trunk@44064 -
2020-01-29 22:21:14 +00:00
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
florian
f7a052f884 + inline high(<dyn. array>), resolves #28536
git-svn-id: trunk@43808 -
2019-12-28 21:38:38 +00:00
Jonas Maebe
d23c7980aa * properly perform (or not) range/overflow checking when performing constant
propagation into inlined routines, regardless of the range/overflow
    checking state at the caller site

git-svn-id: trunk@43436 -
2019-11-10 12:00:05 +00:00
svenbarth
b0ac0ddcc9 + add support for the IsManagedType() intrinsics which reports for a type (or variable) whether it needs initialization/finalization
+ added tests

git-svn-id: trunk@43409 -
2019-11-06 23:04:52 +00:00
Jonas Maebe
a051b8d225 - remmoved doregister parameter from t*sym constructors, as the registration
is handled automatically nowadays

git-svn-id: trunk@42998 -
2019-09-14 17:30:45 +00:00
Jonas Maebe
14a7429e19 * factored out inlinenode check whether it may have a side effect
o also added register assert as having a side-effect (if asserts are
     enabled)

git-svn-id: trunk@42728 -
2019-08-18 15:55:03 +00:00
Jeppe Johansen
7dc515b62c - Fix result type of SizeOf and BitSizeOf to use sizesint instead of sint.
git-svn-id: trunk@42337 -
2019-07-07 14:37:45 +00:00
Jonas Maebe
0a91fcb44f * LLVM-specific support for bsr*/bsf*
git-svn-id: trunk@42309 -
2019-06-29 16:27:18 +00:00
Jonas Maebe
c038e4c3f2 * relaxation of r42272: again only show warnings rather than errors for
out-of-range constants, because of the comments mentioned in #35753
    (except for enums, as apparently Delphi does the same)
  * added range check warnings about explicit type casts that throw away
    bits (e.g. byte($fff)), without giving warnings for most common cases
    (like cardinal(-1))
  * fixed masking/sign exting constant array indices (must be based on index
    range type size/signedness rather than on array size/"signedness")

git-svn-id: trunk@42275 -
2019-06-23 14:12:33 +00:00
pierre
243c967967 Commit of new debug feature implemented by J. Gareth Moreton
Allows compilation of compiler using -dDEBUG_NODE_XML
  which will generate a NAME-node-dump.xml file for each 
  unit, program or library compiled,
  containing a XML description of the nodes handled during
  compilation of the unit, program or library.

git-svn-id: trunk@42271 -
2019-06-22 14:08:47 +00:00
Jonas Maebe
1b6425176b * synchronised with trunk till r42049
git-svn-id: branches/debug_eh@42050 -
2019-05-12 18:44:05 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
Jonas Maebe
a0d796e98d * synchronised with trunk till r41159
git-svn-id: branches/debug_eh@41160 -
2019-02-01 17:01:54 +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
Jonas Maebe
473fef315d * synchronised with trunk till r40732
git-svn-id: branches/debug_eh@40733 -
2019-01-01 16:24:18 +00:00
Jonas Maebe
ff8ccb06e5 * changed reverseparameters() from function into procedure: it does not make
sense as a function (the original input needed to be replaced by its
    result to make any sense), and someone already mistakenly used it like that
    in htypechk causing a bug/memory leak

git-svn-id: trunk@40729 -
2019-01-01 15:08:40 +00:00
Jonas Maebe
882d676bc9 * synchronised with trunk till r40635
git-svn-id: branches/debug_eh@40636 -
2018-12-24 22:12:19 +00:00
Jonas Maebe
3ccc3e329b * prevent calling firstpass multiple times for a node (such as when
transforming inc/dec to an addn/subn in case of range checking) from
    triggering the transformation logic for accessing nested variables
    on LLVM/JVM multiple times
  * also prevent it from triggering errors during inlining, in case a
    parameter to a nested routine gets replaced by a local variable
    from a parent routine (in that case, it does not need to be
    accessed via the parentfpstruct, as we are being inlined in the
    parent) -> don't duplicate the check from pass_typecheck in pass_1,
    but check whether it needs to be accessed via the parentfpstruct
    by verifying that tloadnode.left is assigned (which pass_typecheck
    will ensure if needed)

git-svn-id: trunk@40630 -
2018-12-24 22:09:52 +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
bfc7c58a69 * synchronised with trunk till r40348
git-svn-id: branches/debug_eh@40349 -
2018-11-18 12:01:50 +00:00
pierre
796db4cef5 Implement mark_write override for tinilinenode
git-svn-id: trunk@40277 -
2018-11-08 20:18:30 +00:00
yury
4682ac269d * Further improvement for r40180:
An uninitialized function Result of a managed type needs special handling.
    When passing it as a var parameter a warning need to be emitted, since a user
    may expect Result to be empty (nil) by default as it happens with local vars
    of a managed type. But this is not true for Result and may lead to serious issues.

    The only exception is SetLength(Result, ?) for a string Result. A user always
    expects undefined contents of the string after calling SetLength(). In such
    case a hint need to be emitted.
+ Tests for this.

git-svn-id: trunk@40216 -
2018-11-04 15:37:52 +00:00
yury
4357caaad8 * Removed unused local vars.
git-svn-id: trunk@40183 -
2018-11-02 18:44:29 +00:00
yury
1b151df89f * Make SetLength() to emit hint "Local variable "s" of a managed type does not seem to be initialized" instead of the warning. This change is needed because when calling a regular procedure with a ver parameter of a managed type the hint is generated. Now SetLength() behaves the same.
git-svn-id: trunk@40180 -
2018-11-02 16:19:18 +00:00
Jonas Maebe
84de128194 * fixed result node of fpc_eh_return_data_regno (r40070), resolves compiler
crashes (and invalid results) when using this intrinsic

git-svn-id: branches/debug_eh@40074 -
2018-10-28 19:54:07 +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
pierre
d512d8cae1 Also fix first_abs_real like in rev 39988
git-svn-id: trunk@39997 -
2018-10-20 18:11:25 +00:00
florian
3078cc4b0d * same fix as in r39988 for fpc_first_sqrt
git-svn-id: trunk@39991 -
2018-10-20 10:18:45 +00:00
pierre
7d7f966ccb Fix wrong explicit typecast that lead to memory corruption in first_sqr_real
git-svn-id: trunk@39988 -
2018-10-19 23:04:55 +00:00
Jonas Maebe
0b246f3dbd * converted Boolean8 to an internal type, and mapped Boolean to the
new internal pasbool1(type) (part of mantis #34411)
   o apply the _Bool x86-64 parameter passing rules only to pasbool1

git-svn-id: trunk@39949 -
2018-10-16 21:14:18 +00:00
svenbarth
d5f0d8e306 * addendum for Mantis #34333: also complain about number of arguments with the maximum number of arguments for Copy ( = 3 ) is exceeded
git-svn-id: trunk@39836 -
2018-09-27 19:44:35 +00:00
svenbarth
76c45b1a72 * fix for Mantis #34333: improve error output for incorrect calls to Copy()
git-svn-id: trunk@39817 -
2018-09-26 21:33:51 +00:00
florian
a34d4e715c Merged riscv_new branch
git-svn-id: trunk@39813 -
2018-09-26 19:49:08 +00:00
svenbarth
bf91991bae * fix for Mantis #34332: allow 2 parameter form of Copy also for ShortString variables
+ added test

git-svn-id: trunk@39802 -
2018-09-25 19:10:06 +00:00
florian
4f052e4f90 o fix several issues with floating point exceptions
+ mask underflow and precision on startup
  + check for floating point exceptions after inlined float routine helpers
  - do not check for floating point exceptions after floating point moves 

git-svn-id: branches/laksen/riscv_new@39645 -
2018-08-19 15:26:00 +00:00
svenbarth
3d740f13e4 * ensure that the data of the temp node is freed correctly in case of an error (the error might be non-fatal in case of a generic passing an untyped type to Write/Read)
git-svn-id: trunk@39566 -
2018-08-04 08:37:07 +00:00
svenbarth
781303c0d8 * ensure that the file parameter for the Read/Write family of intrinsics is (and can be) freed in tinlinenode.handle_read_write()
git-svn-id: trunk@39565 -
2018-08-04 08:37:01 +00:00
florian
9af9658fa7 * first parameter of SetLength must be valid, as it is read
git-svn-id: trunk@39347 -
2018-06-30 11:25:43 +00:00
svenbarth
9b45f58c0b + add flags that allow checking for overloads with isbinaryoverloaded() and isunaryoverloaded() without modifying the passed in node or even checking for normally non-overloadable operators
git-svn-id: trunk@39258 -
2018-06-20 19:53:34 +00:00
svenbarth
0e5a598b6a * don't use a vecnode to convert a dynamic array or an array constructor to a pointer as that will lead to problems with range checking if the array should be empty; fixes run of tarray12 with -Cr
git-svn-id: trunk@38368 -
2018-02-27 21:43:21 +00:00
svenbarth
916ff0b92c + extend Concat() with support for dynamic arrays
+ added test

git-svn-id: trunk@37723 -
2017-12-12 19:54:08 +00:00
florian
194c0c7073 * compilation fixed
git-svn-id: trunk@37546 -
2017-11-01 16:54:08 +00:00
florian
4752b0ef96 + tinlinenode calls cpu specific routines for unknown inline numbers
git-svn-id: trunk@37543 -
2017-11-01 16:33:32 +00:00
svenbarth
f6a867ef04 * move handling of Concat to tinlinenode so that it can be easily extended for dynamic arrays
+ added test

git-svn-id: trunk@37429 -
2017-10-08 10:39:34 +00:00
svenbarth
b3ee9339b8 * also report the dynamic array "overloads" for the Insert() intrinsics
git-svn-id: trunk@37343 -
2017-09-27 21:18:04 +00:00
svenbarth
c5b33f51f9 * fix for Mantis #32412: correctly handle an incorrect parameter count for Delete() and Insert() intrinsics
+ added tests

git-svn-id: trunk@37342 -
2017-09-27 21:15:00 +00:00