florian
1700516721
* cleanup
2022-11-26 23:27:02 +01:00
florian
247423400f
* create muln with create instead of create_internal when converting "n - n mod const)" so pass1 works properly, resolves #40004
2022-11-24 22:43:27 +01:00
Pierre Muller
84be45f55d
Fix compilation failure of RTL with -Co option for x86_64-linux target
2022-11-24 17:01:37 +00:00
Pierre Muller
1a19fe1f03
Use correct class typecast for commit ba4cee279b
2022-11-23 08:43:28 +01:00
florian
0ba4cee279
* convert n-n mod const into n div const*const, resolves #39615
2022-11-22 22:41:58 +01:00
florian
f6a8b045c2
* cosmetics
2022-11-21 22:10:29 +01:00
Sven/Sarah Barth
02aac653d2
* optimize shortstring concatenations if they're on the right side of an assignment to directly use the left side instead of a temporary
2022-10-09 13:56:52 +02:00
Sven/Sarah Barth
32261a0f6d
* fix copy/paste typo in comments
2022-10-09 13:56:52 +02:00
florian
ad7cc0e69d
* handle <dyn.array>+[] (and swapped) correctly, resolves #39919
2022-10-05 22:48:21 +02:00
Jonas Maebe
a6c7ed5e61
vector support: use vector result types
...
Set the result of a vector add node to a vector type.
Ensure that that these vector types are still asignment-compatible with
regular array types (may want to change this when we expose vector types),
and don't remove type conversions from vector types to array types (so the
code generator pass can still rely on the resultdef being a vector type)
2022-09-16 11:21:04 +02:00
Jonas Maebe
cb96acefc9
vector support: check supported type during parsing already
...
Avoids internalerrors at the code generation stage when using an unsupported
type
2022-09-16 11:21:04 +02:00
florian
f9a4631adf
* don't switch a+/-/sqr(b) into an fma statement if b is too complex
2022-08-27 21:22:16 +02:00
florian
f6b5c513bb
* patch by Rika: makes #39786 work on more setups, resolves #39786
2022-07-07 23:00:47 +02:00
florian
fcb5531fbc
* convert a+/-const1-/const2 in into a+/-(-const1)+(-const2) to enable further optimizations, resolves #39782
2022-07-01 23:04:50 +02:00
florian
95dfccbb5e
* do not optimize away +0.0 if no fastmath is passed as -0.0+(+0.0)=+0.0
2022-06-25 21:39:57 +02:00
florian
94665a40d7
* optimize a-const1-const2 when const1 and const2 are real constants and fast math is on, part of fixing #39782
2022-06-17 23:39:17 +02:00
Jonas Maebe
573f2c20d7
taddnode.cmp_of_disjunct_ranges: fortify in case of programs with errors
...
Fixes compilation of webtbf/tw3116 with a compiler compiled with -Cr
2022-05-29 13:33:27 +02:00
Sergey Larin
60c967f255
Optimized the comparison of a widestring variable with ''
2022-04-27 21:12:47 +00:00
Sergey Larin
35db2b2da3
Fixed optimization Length(W)=0
-> (Pointer(W)=nil) or (PLongword(Pointer(W)-4)^=0)
for WideString
2022-04-27 21:12:47 +00:00
florian
81c8078735
* reorder string expressions with parentheses so fpc_*_concat_multi can be used efficiently, resolved #39479
2022-02-21 23:09:16 +01:00
florian
f21f7f0f50
* handle result type of unsigned ordinal operations in ISO/Extpas mode similiar to TP, solves
...
#37875
2022-01-28 22:48:50 +01:00
florian
e132ae2fee
* last commit was not correct, fixed
2021-11-27 00:28:57 +01:00
florian
bf5f37b14a
* fix conditional statement as pointed out by Sergey Larin
2021-11-26 22:27:19 +01:00
florian
6404478ea4
* cleanup of VER3_0 defines
2021-11-17 22:19:57 +01:00
florian
292be9029e
* when converting a*a into sqr(a), set the result type correctly
...
* removefloatupcasts takes care of cs_excessprecision, resolves #39012
2021-11-07 21:54:25 +01:00
florian
5a617cd108
+ fold real constants c1,c2 for v+c1+c2 or c1+(c2+v) (+ being either + or *) as well if fastmath is enabled
2021-10-31 17:38:08 +01:00
florian
ff3acfb8cd
* cleanup of 2.7.0 defines
2021-10-31 13:20:28 +01:00
florian
08050086b9
* keep type when removing "1*", resolves #38840
2021-10-17 22:23:49 +02:00
florian
00d4a6889d
* add no internal flag when folding constants in taddnode.simplify, resolves #39308
2021-10-12 22:59:45 +02:00
florian
8cb92fd49a
* simplify real expressions involving unary minus
...
+ test
2021-09-19 23:08:32 +02:00
Pierre Muller
33ad038bbb
* Avoid some wrong error messages after initial error
...
On x86_64-openbsd, cycling with -O3 option fails due to
a wrong warning about uninitialized zeros variable in
compilation of ogbase unit
ogbase.pas(2310,41) Warning: Local variable "zeros" does not seem to be initialized
ogbase.pas(2318,39) Error: Can't evaluate constant expression
The second message is due to the fact that simplify is not
called inside nadd unit if errorcount is non-zero.
By replacing errorcount<>0 by not codegenerror,
this message disappears.
2021-09-06 19:23:56 +00:00
florian
3069d74ecc
* handle constant folding correctly for <pointer>+<ord. constant>+<ord. constant>, resolves #39332
2021-09-01 21:32:27 +02:00
Yuriy Sydorov
6a3f32ba69
* optimize tests for a single bit "(a and one_bit_mask_const) = <> one_bit_mask_const" into "(a and one_bit_mask_const) <> = 0" to enable further CPU specific optimizations.
2021-08-09 18:38:58 +03:00
florian
83ce289ea4
* last commit fixed, hopefully final fix
...
git-svn-id: trunk@48886 -
2021-03-06 15:03:33 +00:00
florian
f448603970
* improved last commit, better handling of boolean expressions
...
git-svn-id: trunk@48885 -
2021-03-06 14:55:50 +00:00
florian
62bd0068b6
* do not apply the (a and b) or (c and not(b)) into c xor ((c xor a) and b) optimziation if short boolean evaluation is used, should resolve #38576
...
* improved test
git-svn-id: trunk@48884 -
2021-03-06 14:48:15 +00:00
florian
e0a1bc6675
+ optimize (a and b) or (c and not(b)) into c xor ((c xor a) and b)
...
+ test
git-svn-id: trunk@48841 -
2021-02-28 18:20:46 +00:00
florian
272a0e3e26
+ apply excess precision also to unary minus nodes
...
* made excess precision really working
git-svn-id: trunk@48840 -
2021-02-28 10:52:11 +00:00
yury
64c586b86d
* Removed/ifdefed lots of unused variables.
...
git-svn-id: trunk@48384 -
2021-01-24 12:24:01 +00:00
florian
12adb47d65
* clean up
...
git-svn-id: trunk@48011 -
2021-01-03 15:03:27 +00:00
florian
3109005791
+ fold also (string const+(string const+string var))
...
* string tree folding code moved into level 2 opt. block
git-svn-id: trunk@47986 -
2021-01-02 22:18:38 +00:00
florian
7de94e7a1d
* properly fold string+string const+string const., resolves #38267
...
git-svn-id: trunk@47977 -
2021-01-02 17:18:54 +00:00
florian
e6037961e3
* refactored constant folding code
...
git-svn-id: trunk@47935 -
2021-01-01 21:58:12 +00:00
florian
97abf6b495
* first part of fixing #38267 : do not bail out early during constant folding
...
if the constant is 1 or -1
git-svn-id: trunk@47933 -
2021-01-01 15:26:13 +00:00
florian
4f3a21eeec
* don't do x*x -> optimziation for xtensa as it causes a recursive call in sqr(...)
...
git-svn-id: trunk@47688 -
2020-12-04 22:43:55 +00:00
florian
6380df9b42
* correctly simplify tree transforms of (a+c1+c2) if a is a pointer, resolves #37671
...
git-svn-id: trunk@47437 -
2020-11-16 21:47:19 +00:00
florian
98eab07abd
* simplified and fixed code of (v1=const1) and (v2=const2) optimization, resolves #38066
...
git-svn-id: trunk@47423 -
2020-11-15 16:17:54 +00:00
florian
ff31d95a69
* excess precision should not be applied to comp or currency
...
git-svn-id: trunk@47246 -
2020-10-28 21:37:27 +00:00
florian
13f1fb60b4
* directly copy the result of set <op> set into the left side of an assignment
...
git-svn-id: trunk@47226 -
2020-10-27 21:42:51 +00:00
Jonas Maebe
0729340817
* try_make_mul32to64: restore original node order if transformation failed
...
o this gets called by taddnode.pass_1, which caches the left/right
node types/resultdefs
git-svn-id: trunk@47158 -
2020-10-23 13:34:24 +00:00