Anonymous avatar Anonymous committed 6cc3072

Change: improve optimization for expressions containing comparison operators by marking them as "return bool"

Comments (0)

Files changed (3)

 CMP_EQ = Operator(
     act2_supports = True,
     actd_supports = True,
+    returns_boolean = True,
     token = '==',
     compiletime_func = operator.eq,
     validate_func = validate_func_float,
 CMP_NEQ = Operator(
     act2_supports = True,
     actd_supports = True,
+    returns_boolean = True,
     token = '!=',
     compiletime_func = operator.ne,
     validate_func = validate_func_float,
 CMP_LE = Operator(
     act2_supports = True,
     actd_supports = True,
+    returns_boolean = True,
     token = '<=',
     compiletime_func = operator.le,
     validate_func = validate_func_float,
 CMP_GE = Operator(
     act2_supports = True,
     actd_supports = True,
+    returns_boolean = True,
     token = '>=',
     compiletime_func = operator.ge,
     validate_func = validate_func_float,
 CMP_LT = Operator(
     act2_supports = True,
     actd_supports = True,
+    returns_boolean = True,
     token = '<',
     compiletime_func = operator.lt,
     validate_func = validate_func_float,
 CMP_GT = Operator(
     act2_supports = True,
     actd_supports = True,
+    returns_boolean = True,
     token = '>',
     compiletime_func = operator.gt,
     validate_func = validate_func_float,
Add a comment to this file

regression/expected/030_house.grf

Binary file modified.

regression/expected/030_house.nfo

 \dx00000000 \wx0023 \b8 \b0 \b0 \b11 \b16 \b7 88 89 8A 
 
 // Name: brewery_sprite_layout@registers - feature 07
-19 * 383 02 07 FF 89 
+19 * 362 02 07 FF 89 
 43 20 \dx000000FF 
 \2cmp 1A 20 \dx00000004 
 \2& 1A 20 \dx00000001 
-\2u< 1A 20 \dx00000001 
 \2sto 1A 20 \dx00000080 	// guard
 \2^ 1A 20 \dx00000001 
 \2sto 1A 20 \dx00000081 	// !guard
 \2cmp 1A 20 \dxFFFFFFFF 
 \2& 1A 20 \dx00000001 
 \2| 7D 84 20 \dxFFFFFFFF 
-\2u< 1A 20 \dx00000001 
 \2^ 1A 20 \dx00000001 
 \2sto 1A 20 \dx00000085 
 \2r 43 20 \dx000000FF 
 \2r 46 20 \dx000000FF 
 \2cmp 1A 20 \dx00000000 
 \2& 1A 20 \dx00000001 
-\2u< 1A 20 \dx00000001 
 \2sto 1A 20 \dx00000087 
 \2r 7D 8C 20 \dxFFFFFFFF 
 \2u< 1A 20 \dx00000001 
 \wx80FE // default: return 254;
 
 // Name: @return_action_0
-32 * 48 02 07 FE 89 
+32 * 41 02 07 FE 89 
 46 20 \dx000000FF 
 \2cmp 1A 20 \dx00000000 
 \2& 1A 20 \dx00000001 
-\2u< 1A 20 \dx00000001 
 \2* 1A 20 \dxFFFFFF04 	// expr1 - expr2
 \2+ 1A 00 \dx000000FD 
 \b0 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.