Commit Graph

1755 Commits

Author SHA1 Message Date
Jonathan G Rennison
376b434d53 VarAction2: Re-order commutative skip on zero operation sequences
Such that less expensive variables can be tested first
2022-06-08 20:29:46 +01:00
Jonathan G Rennison
0409bd88e8 VarAction2: Simplify tracking of sprite group feature 2022-06-08 20:22:53 +01:00
Jonathan G Rennison
caebff85f5 VarAction2: Add helper functions for constant comparison adjust types 2022-06-08 19:40:36 +01:00
Jonathan G Rennison
249a20e47a VarAction2: Add helper functions for relational comparison ops 2022-06-08 19:22:00 +01:00
Jonathan G Rennison
31e96ff5e7 VarAction2: Add helper functions for anti-commutative ops 2022-06-08 19:15:56 +01:00
Jonathan G Rennison
5db30e559e VarAction2: Store substitutions can now handle inversions 2022-06-08 19:07:30 +01:00
Jonathan G Rennison
b95116e4fc VarAction2: Apply XOR bool inversion conversions after DSE 2022-06-08 18:06:38 +01:00
Jonathan G Rennison
2bbfa37730 VarAction2: Replace reversed commutative/sub op via temp storage in DSE pass 2022-06-08 17:53:16 +01:00
Jonathan G Rennison
45ac1a89aa VarAction2: Apply XOR with 1 bool logic inversion in more cases
Fixes case of DSE-delayed var substitutions
2022-06-08 02:34:54 +01:00
Jonathan G Rennison
1c1e6a1042 VarAction2: Prune deterministic sprite group children again after DSE 2022-06-08 00:05:22 +01:00
Jonathan G Rennison
6e398f9cec VarAction2: DSE now takes into account DSE results from child groups 2022-06-07 23:53:32 +01:00
Jonathan G Rennison
65407210a6 VarAction2: Allow DSGA_OP_STO_NC to be used with DSGA_TYPE_EQ/NEQ 2022-06-07 22:21:51 +01:00
Jonathan G Rennison
d3dce79d73 VarAction2: Substitute single-use vars through temp storage in DSE pass 2022-06-07 22:03:02 +01:00
Jonathan G Rennison
0310692acf VarAction2: Only substitute cheap vars through temp storage in 1st pass 2022-06-07 20:22:57 +01:00
Jonathan G Rennison
f54530b1b2 VarAction2: Add checks for vars 7B, 7C when getting previous single load 2022-06-07 19:53:42 +01:00
Jonathan G Rennison
a8c0e47dd8 VarAction2: If DSE results in a redundant load, remove it 2022-06-07 19:25:08 +01:00
Jonathan G Rennison
86324e0fda Debug: Add mode to sprite dump window to show unoptimised 2022-06-07 18:54:42 +01:00
Jonathan G Rennison
74681f70d9 VarAction2: Replace inverted OR of bools with AND where this makes sense 2022-06-06 23:13:09 +01:00
Jonathan G Rennison
e41a5d2f63 VarAction2: Add flags to skip adjust if value is 0 or LSB set 2022-06-06 23:04:45 +01:00
Jonathan G Rennison
236cbc4e83 VarAction2: Optimise SAR same as SHR on unsigned inputs 2022-06-06 22:47:53 +01:00
Jonathan G Rennison
9d04ebcc90 VarAction2: Remove operations which always do nothing when applied to 0 2022-06-06 22:20:16 +01:00
Jonathan G Rennison
26dd84f931 VarAction2: Optimise OR followed by XOR of same constant 2022-06-06 22:17:14 +01:00
Jonathan G Rennison
3aa0ccb97b VarAction2: Optimise OR which always produces 1 2022-06-06 22:17:14 +01:00
Jonathan G Rennison
4b7288902d VarAction2: Consider industry tile vars 0x60 to 0x62 to be expensive 2022-06-06 21:10:40 +01:00
Jonathan G Rennison
3a5902ff77 VarAction2: Reduce cost of RecursiveDisallowDSEForProcedure
Fix disallowing DSE also disallowing store simplification
2022-06-06 20:09:48 +01:00
Jonathan G Rennison
c342b4219b NewGRF: Use per-GRF text ID map in GetGRFStringID 2022-06-06 19:34:22 +01:00
Jonathan G Rennison
3ea1e27fdd Merge branch 'master' into jgrpp
# Conflicts:
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/lang/spanish_MX.txt
#	src/lang/traditional_chinese.txt
#	src/script/api/script_airport.cpp
#	src/script/api/script_rail.cpp
2022-06-06 01:05:00 +01:00
Jonathan G Rennison
f05b5163f7 Fix narrowing converison warning 2022-06-05 16:09:50 +01:00
Jonathan G Rennison
bbc1e28b24 VarAction2: Re-use allocated callback result sprite groups 2022-06-04 20:31:09 +01:00
Jonathan G Rennison
e5ef888e80 VarAction2: Add variable/constant copy store simplifification 2022-06-04 02:12:23 +01:00
Jonathan G Rennison
a93b3948b5 VarAction2: Don't change variable masks when disabling procedure DSE 2022-06-04 02:12:23 +01:00
Jonathan G Rennison
3d42e36f89 VarAction2: Avoid pessimising DSE when a procedure returns a callback result 2022-06-04 02:12:23 +01:00
Jonathan G Rennison
9e414a1eab VarAction2: Move optimiser flags to a separate setting 2022-06-04 02:12:23 +01:00
Jonathan G Rennison
6ff8066d34 VarAction2: Ensure that a temp store var can't reference a clobbered var 2022-06-04 02:12:23 +01:00
Jonathan G Rennison
fe6ab0f19f VarAction2: Don't track var copies through temporary storage for stations
Except for copies of other temporary storage vars
2022-06-03 23:28:43 +01:00
Jonathan G Rennison
db7f29b07c VarAction2: Deduplicate loads from expensive uncached variables
Currently only some vehicle variables
2022-06-03 20:14:30 +01:00
Jonathan G Rennison
6a17f00a27 VarAction2: Ensure dead store elimination doesn't break variable 0x7B 2022-06-03 19:13:07 +01:00
Jonathan G Rennison
813146a78f VarAction2: Track value inferences through temp storage in more cases 2022-06-03 16:04:57 +01:00
Jonathan G Rennison
ccef3646db VarAction2: Set value inferences for operations with eq/neq adjust types 2022-06-03 16:04:44 +01:00
Jonathan G Rennison
04a9c73ec2 VarAction2: Combine RST, UMIN sequence to load with neq 0 adjust 2022-06-03 15:34:50 +01:00
Jonathan G Rennison
9116ca6bb0 VarAction2: Track copies of variables through temporary storage 2022-06-03 15:23:33 +01:00
Jonathan G Rennison
263a87f5da VarAction2: Add adjust types for combined (in)equality with constant 2022-06-03 14:17:15 +01:00
Jonathan G Rennison
1e52e51ce1 VarAction2: Add bounds checks to previous adjust accesses 2022-06-03 14:00:00 +01:00
Jonathan G Rennison
c2fde53495 VarAction2: Remove redundant variable loads 2022-06-03 12:51:58 +01:00
Jonathan G Rennison
30f74c5b74 Sprite group: Add getter function for sprite groups 2022-06-01 23:47:03 +01:00
Jonathan G Rennison
d8f9641dc9 VarAction2: Remove redundant UMIN operation on already boolean values 2022-06-01 23:01:50 +01:00
Jonathan G Rennison
3c9201ebd5 VarAction2: Fix dead store elimination through randomised sprite groups 2022-06-01 22:36:04 +01:00
Jonathan G Rennison
e0581db2a1 VarAction2: Remove dead stores and redundant adjusts in more cases 2022-05-31 03:26:45 +01:00
Jonathan G Rennison
d71e38446e Improve performance of string lookup in AddGRFString 2022-05-30 23:51:44 +01:00
Jonathan G Rennison
994dc683a2 VarAction2: Fix calculated result groups being incorrectly pruned 2022-05-30 17:24:26 +01:00