-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Augmentable operators optimization: * is commutative when an operand …
…is scalar (#377) I hoped to make it handle all cases (`*` is commutative when at least one operand is scalar or both are vector) but that would require determining the type of an expression. For now, when an operand is a variable declared as a scalar type the optimization is possible for `*`.
- Loading branch information
1 parent
cccfcd7
commit ccd10bc
Showing
5 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ float result; | |
void main() | ||
{ | ||
float x=.5; | ||
x=.6*x*x; | ||
x*=.6*x; | ||
result=x; | ||
} | ||
int arithmetic() | ||
|