Commit Graph

307 Commits

Author SHA1 Message Date
Frederic Kehrein
9424bbe95b Merge branch 'sliceiter' into 'main'
Adding for-in loop iteration over slices

See merge request freepascal.org/fpc/source!827
2025-04-04 05:36:58 +00:00
Michaël Van Canneyt
d3a0a2dddf * Call free instead of destroy 2025-03-21 14:25:19 +01:00
florian
7aae7a8d51 + min/max optimization support for RiscV 2025-01-06 15:21:18 +01:00
florian
b4d3468f68 * use HAS_MINMAX_INTRINSICS define 2025-01-06 15:21:18 +01:00
florian
798f2ba632 * better code for ... downto 1 for-loops 2024-11-28 22:32:38 +01:00
florian
246d7865c5 * less strict condition when a loop decrement can be moved to the end of a loop to increase code quality 2024-11-27 22:56:30 +01:00
florian
511beac49c * get rid of the hack that tlabelnode inherits from tunarynode and stores a statement in left, resolves #40964 2024-10-26 16:11:24 +02:00
J. Gareth "Curious Kit" Moreton
205e4f3421 * "checkcontinue" replaced with "has_child_of_type(..., [continuen])" 2024-10-18 18:26:48 +00:00
Frederic Kehrein
7b8e72ef07 Adding for-in loop iteration over slices 2024-10-12 20:51:28 +02:00
Sven/Sarah Barth
953a4e1b64 * fix #40563: apply slightly adjusted patch by byte bites to use fixed range of 1..Length(str) for for-in loops iterating over ShortStrings
+ added test
2024-06-04 22:53:16 +02:00
J. Gareth "Curious Kit" Moreton
e4a0ce2fb5 * x86: Min/max intrinsic support 2024-03-26 14:18:31 +00:00
J. Gareth "Curious Kit" Moreton
81b7b80749 * Added support for 64-bit min/max intrinsics 2024-03-26 14:18:31 +00:00
J. Gareth "Curious Kit" Moreton
2b7df4237b * nf_pass1_done, nf_error, nf_processing and nf_do_not_execute
have been moved to a new "transientflags" node field that
    isn't stored in PPU files
2024-03-24 18:14:49 +00:00
Sven/Sarah Barth
68668c649e * fix #40500: do a for-in on a string variable using low(strvar) to high(strvar) so that zero based strings are handled correctly
+ added test
2023-11-07 20:28:15 +01:00
florian
5670a7543c * properly reset nf_write/nf_modify flags for min/max inline nodes, needed by dead store optimization, resolves #39958
* factored out nutils.node_reset_pass1_write
2022-10-16 22:51:50 +02:00
Sven/Sarah Barth
815734c47a * fix #32034 and fix #39656: in a for-in-loop with an array constructor enforce the type of the loop variable for the elements
+ added tests
2022-04-08 17:40:36 +02:00
florian
e443936e12 + in_min/max_dword/longint support for aarch64 2021-12-19 16:16:44 +01:00
florian
77b9d62520 + in_min/max_single/double support for aarch64 2021-12-18 21:23:21 +01:00
Yuriy Sydorov
5b32c81bef * Corrected setting of the flag. 2021-11-02 20:33:34 +02:00
Yuriy Sydorov
e04df465ef * The label which is generated by traisenode is not a jump target. Mark
this label as nf_internal, which means the label does not impact the
  code flow. This leads to a much better register allocation.
2021-11-02 16:46:09 +02:00
pierre
39896a1b11 Destroy tfornode class loopiteration field if assigned
git-svn-id: trunk@49329 -
2021-05-03 16:04:19 +00:00
Jonas Maebe
9977889f4a * fix finally block getting unconditionally removed if try-block is empty
(hasnocode(nil) always returns true). Regression from r48174

git-svn-id: trunk@49305 -
2021-05-01 09:28:58 +00:00
florian
a32a870f33 * another loop counter copying fix
git-svn-id: trunk@49028 -
2021-03-21 21:39:57 +00:00
florian
c4ddb94cb4 * remove nf_write from the counter node when converting for loops into while loops if the counter is only read
git-svn-id: trunk@49020 -
2021-03-20 21:28:58 +00:00
yury
75491ae21c * Removed/ifdefed the assigned and unused variables.
git-svn-id: trunk@48391 -
2021-01-24 13:58:17 +00:00
yury
0a021be803 * Corrected visibility of overridden methods.
git-svn-id: trunk@48385 -
2021-01-24 12:41:12 +00:00
florian
16f201292c + remove try ... finally statements if the finally block is empty
git-svn-id: trunk@48174 -
2021-01-18 21:29:52 +00:00
florian
0fd7a5cb1f * lines with 255 chars a little bit long, reformated them
git-svn-id: trunk@47845 -
2020-12-24 13:13:42 +00:00
florian
6db164c993 * min/max optimization needs to check both operands of the if condition, even if no else-statement is passed, resolves #38249
git-svn-id: trunk@47843 -
2020-12-23 22:41:37 +00:00
florian
6d7d567a25 * min/max optimization on x86 can be applied now without fastmath as NaN is handled properly now
git-svn-id: trunk@47769 -
2020-12-13 09:52:45 +00:00
florian
88a0d4d64b + optimize if x>a then x:=a; into min(a,x);, similiar for max
* test extended

git-svn-id: trunk@47767 -
2020-12-13 09:52:44 +00:00
florian
3707cb4b1e * handle min/max properly if it is applied to NaNs
* test extended

git-svn-id: trunk@47729 -
2020-12-08 20:41:58 +00:00
florian
8d238cfaa1 * limit min/max optimization to fastmath for now, as the NaN handling is not working yet
git-svn-id: trunk@47704 -
2020-12-06 20:22:39 +00:00
florian
d49453edba * quick fix for llvm compilation
git-svn-id: trunk@47702 -
2020-12-06 19:31:03 +00:00
florian
1a9678f4c4 + min/max support for x86
git-svn-id: trunk@47701 -
2020-12-06 18:09:30 +00:00
florian
4f3271500a * (modified) patch by Christo Crause: ESP8266 doesn't support min/max instructions, resolves #38175
git-svn-id: trunk@47699 -
2020-12-06 16:37:54 +00:00
florian
19ce665b3d * compilation fixed
git-svn-id: trunk@47696 -
2020-12-06 14:18:59 +00:00
florian
57dc416d96 + replace appropriate if statements by min/max intrinsics
+ support min/max intrinsic on xtensa

git-svn-id: trunk@47693 -
2020-12-05 22:00:59 +00:00
florian
878f6d9ce4 * allow generic parameters as iterator variable in for in loops, resolves #38050
git-svn-id: trunk@47425 -
2020-11-15 19:10:34 +00:00
florian
e1536bdf26 * when implicit try...finallys are turned off, do not throw an error if a procedure
is left which would need but does not have an implicit try...finally block, resolves #37823

git-svn-id: trunk@46974 -
2020-09-27 16:53:59 +00:00
florian
0bdc1fdea4 * do not set nonlocal for inter-procedural labels, this is not needed, they use
the jmpbuf to reach the target

git-svn-id: trunk@46907 -
2020-09-20 18:57:00 +00:00
florian
61d44bba17 * allow iso gotos within a procedure
git-svn-id: trunk@46396 -
2020-08-12 19:07:23 +00:00
svenbarth
55c1ecedac * set implicitframe for copied tryfinally nodes as well
git-svn-id: trunk@44956 -
2020-04-21 06:07:03 +00:00
florian
aca9727418 + OptimizeForLoop: convert for-loops into zero-based backward for-loops if possible, for most architectures, this results in simpler code
git-svn-id: trunk@44287 -
2020-03-08 14:30:59 +00:00
florian
1486ab7c70 * do not throw a warning about unreachable code if the responsible node was generated internally
git-svn-id: trunk@44051 -
2020-01-27 22:27:22 +00:00
florian
22197641b8 * last commit fixing calculation of do_loopvar_at_end was not complete,
hopefully finally fixed

git-svn-id: trunk@44041 -
2020-01-26 20:13:17 +00:00
florian
74272975af * do_loopvar_at_end is not possible if the loop counter would overflow with
the last iteration

git-svn-id: trunk@44039 -
2020-01-26 15:35:03 +00:00
florian
069e040e49 * do for-loop unrolling after for-loop simplification, resolves #36589
git-svn-id: trunk@43999 -
2020-01-19 18:21:12 +00:00
florian
2f2b378c03 * moved conversion of for into while loops in a separate pass, so node optimizations on the node tree can be
carried out without losing information from for loops

git-svn-id: trunk@43910 -
2020-01-11 16:08:45 +00:00
florian
f424ae3929 - cleanup comment
git-svn-id: trunk@43906 -
2020-01-10 21:34:30 +00:00