Commit Graph

298 Commits

Author SHA1 Message Date
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
florian
fd0012deff * when copying goto nodes take care if the label node is part of the copied tree
or not, resolves #35820

git-svn-id: trunk@43793 -
2019-12-25 17:10:14 +00:00
Jonas Maebe
e775ecdc43 * cleaned up safecall support: use a hidden localvarsym instead of result
register hacking
   o this also allowed fixing/adding safecall support for LLVM

git-svn-id: trunk@43578 -
2019-11-24 20:23:22 +00:00
svenbarth
0a915e883e * keep track of static symbols that a global function references, as those must now be exported from a dynamic package as well if the function can potentially be inlined
git-svn-id: trunk@43544 -
2019-11-21 21:44:53 +00:00
Jonas Maebe
ac1e0f96bd * replaced tentryfile.get/putsmall/normalset() with a common tget/putset
that expects an open array of byte, and use it for all sets
   o since all sets need to be typecasted to an array type of the appropriate
     size, we'll get a compilation error in case this needs to be done and
     that also tells us at the same time that the ppu version will need to
     be increased
  * enabled {$packset 1} for the compiler, as this is now safe with the above
    changes

git-svn-id: trunk@43407 -
2019-11-06 21:50:19 +00:00
Jonas Maebe
e3e23df7e2 * document how tgotonode/tlabelnode copying works
git-svn-id: trunk@42986 -
2019-09-13 19:06:34 +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
50c82b6468 * synchronised with trunk till r41537
git-svn-id: branches/debug_eh@41538 -
2019-03-01 16:20:22 +00:00
yury
e5c2d13671 * Do not set pi_needs_got in current_procinfo.flags at the node level, since the GOT usage can only be estimated there. Instead set the pi_needs_got flag at places where the GOT register is accessed during the code generation. This eliminates generation of the unneeded initialization of the GOT register and fixes linker errors when the _GLOBAL_OFFSET_TABLE_ symbol is referenced but no actual GOT references are present.
git-svn-id: trunk@41460 -
2019-02-25 13:35:40 +00:00
florian
f66d7d431f * ensure that the label points inside the range where the raise is located for psabieh
git-svn-id: branches/debug_eh@41384 -
2019-02-19 22:19:30 +00:00