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
Jonas Maebe
099134b545
* fix try_make_mul32to64() if it's called with a constant node on the
...
left (mantis #37878 )
o can happen if use_generic_mul32to64 returns false
git-svn-id: trunk@47142 -
2020-10-19 19:10:16 +00:00
florian
637976e83f
* patch by Marģers to unify internal error numbers, resolves #37888
...
git-svn-id: trunk@47103 -
2020-10-13 19:59:01 +00:00
florian
65047cecdb
+ optimize comparisons of constant pointers
...
git-svn-id: trunk@47031 -
2020-10-01 20:33:03 +00:00
florian
e124b07e86
+ evaluate typeinfo(<type1>)=/<>typeinfo(<type2>) at compile time, resolves #30260
...
git-svn-id: trunk@47008 -
2020-09-29 20:14:27 +00:00
Jonas Maebe
aa75d39ab5
* don't perform "(x=y) or (z=u)" -> "(x xor y) or (z xor u)" optimization
...
if z or u may raise exceptions (mantis #37780 )
git-svn-id: trunk@46905 -
2020-09-20 12:43:45 +00:00
yury
6878ffbf04
* In the TP mode for 16-bit CPUs uint8+uint8 is extended to sint16+sint16. This is TP compatible.
...
git-svn-id: trunk@46468 -
2020-08-17 09:25:45 +00:00
florian
18b8b9c566
* do not apply range test optimization if the variable is a string being compared against a char constants, resolves #37476
...
git-svn-id: trunk@46453 -
2020-08-15 18:29:26 +00:00
florian
d7ba09f543
* insert type casts when creating new unaryminus nodes during simplification, resolves #37508
...
git-svn-id: trunk@46309 -
2020-08-07 21:43:00 +00:00
florian
e14a3f17e6
* reverted r46220 as it is fixed now properly
...
git-svn-id: trunk@46276 -
2020-08-05 21:15:33 +00:00
yury
719220e8a4
* For 8/16 bit CPUs and TP mode, disable expansion to a larger integer type for subtract operations on unsigned integers. This is TP7 compatible.
...
git-svn-id: trunk@46233 -
2020-08-04 20:45:29 +00:00
svenbarth
c17ad509e2
* fix for Mantis #36775 : apply patch by J. Gareth Moreton
...
+ added tests
git-svn-id: trunk@46220 -
2020-08-03 21:53:29 +00:00
Jonas Maebe
346adf7f55
* replace explicit (sometimes incomplete) tests with calls to doshortbooleval()
...
* the c-style boolean evaluation of "and" is independent of short-circuit evaluation
(you always have to consider the complete values in case the first one is <> 0)
git-svn-id: trunk@45990 -
2020-08-02 14:39:50 +00:00
florian
5f118da600
* optimize a/a and a-a if fast math is on
...
git-svn-id: trunk@45630 -
2020-06-09 20:50:47 +00:00
florian
aafc22bd74
+ optimize real operations with 0 and 1 if fast math is turned on
...
git-svn-id: trunk@45627 -
2020-06-08 20:33:27 +00:00
florian
6d3b74f96e
* extended r45555 to take care of chars as well
...
git-svn-id: trunk@45565 -
2020-06-02 20:58:44 +00:00
florian
792cf056eb
* a nil node is also a constant pointer node
...
+ convert (v1=const1) and (v2=const2) into ((v1 xor const1) or (v2 xor const2))=0 if the expressions have no side effects
git-svn-id: trunk@45555 -
2020-06-01 20:50:38 +00:00
florian
7a60e044e3
* simplify constant expressions after re-ordering, resolves #37062
...
git-svn-id: trunk@45360 -
2020-05-13 20:26:04 +00:00
florian
e5e386f94a
* cosmetics
...
git-svn-id: trunk@45327 -
2020-05-10 18:41:10 +00:00
florian
ebcae70d72
* avoid unncessary conversions of constants in 64 bit ints when doing constant folding
...
git-svn-id: trunk@45326 -
2020-05-10 15:25:31 +00:00
florian
bdabf674e1
* propagate forinline
...
git-svn-id: trunk@45319 -
2020-05-09 17:36:36 +00:00