skia2/tests/sksl/runtime
John Stiles 626dbe195a Add test for commutative operations in SkVM.
SkVM should be able to optimize away these equivalent expressions:

	(intA & intB)   <->  (intB & intA)
	(intA ^ intB)   <->  (intB ^ intA)
	(intA | intB)   <->  (intB | intA)
	(intA + intB)   <->  (intB + intA)
	(intA * intB)   <->  (intB * intA)
	(intA == intB)  <->  (intB == intA)
	(intA != intB)  <->  (intB != intA)

These should be guaranteed by IEEE754 as well:

	(floatA + floatB)   <->  (floatB + floatA)
	(floatA * floatB)   <->  (floatB * floatA)

I've added a test to demonstrate existing behavior, which leaves these
optimizations on the table.

Change-Id: I01ce1d6f1cfadb3d77db405a83752c9dd52c99bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473238
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-11-18 21:16:48 +00:00
..
AllowNarrowingConversions.skvm
AllowNarrowingConversions.stage
ArrayIndexing.skvm Add trace coordinates to SkVMDebugInfo. 2021-11-17 21:56:42 +00:00
ArrayIndexing.stage Add variable slot information to SkVMDebugInfo. 2021-11-15 14:24:08 +00:00
ArrayNarrowingConversions.skvm Add unit test for array narrowing conversions. 2021-08-06 13:05:35 +00:00
ArrayNarrowingConversions.stage Add tests for array assignment with narrowing conversions. 2021-08-11 12:56:40 +00:00
Blend.skvm
Blend.stage
Commutative.skvm Add test for commutative operations in SkVM. 2021-11-18 21:16:48 +00:00
Commutative.stage Add test for commutative operations in SkVM. 2021-11-18 21:16:48 +00:00
ConstPreservation.skvm
ConstPreservation.stage Emit prototypes in Pipeline for every defined function. 2021-09-30 21:37:26 +00:00
ConversionConstructors.skvm
ConversionConstructors.stage
GlobalVariables.skvm
GlobalVariables.stage Emit prototypes in Pipeline for every defined function. 2021-09-30 21:37:26 +00:00
GLSLTypeNames.skvm
GLSLTypeNames.stage
LargeProgram_BlocklessLoops.skvm Add program-too-large test using for loops without blocks. 2021-09-15 14:19:00 +00:00
LargeProgram_BlocklessLoops.stage Add program-too-large test using for loops without blocks. 2021-09-15 14:19:00 +00:00
LargeProgram_FlatLoop.skvm Enforce an upper bound on Runtime Effect program size. 2021-09-02 14:44:34 +00:00
LargeProgram_FlatLoop.stage Enforce an upper bound on Runtime Effect program size. 2021-09-02 14:44:34 +00:00
LargeProgram_Functions.skvm Enforce an upper bound on Runtime Effect program size. 2021-09-02 14:44:34 +00:00
LargeProgram_Functions.stage Emit prototypes in Pipeline for every defined function. 2021-09-30 21:37:26 +00:00
LargeProgram_NestedLoops.skvm Enforce an upper bound on Runtime Effect program size. 2021-09-02 14:44:34 +00:00
LargeProgram_NestedLoops.stage Enforce an upper bound on Runtime Effect program size. 2021-09-02 14:44:34 +00:00
LargeProgram_SplitLoops.skvm Enforce an upper bound on Runtime Effect program size. 2021-09-02 14:44:34 +00:00
LargeProgram_SplitLoops.stage Emit prototypes in Pipeline for every defined function. 2021-09-30 21:37:26 +00:00
LargeProgram_StackDepth.skvm Reject programs which exceed 50 stack frames during size analysis. 2021-09-03 02:41:34 +00:00
LargeProgram_StackDepth.stage Emit prototypes in Pipeline for every defined function. 2021-09-30 21:37:26 +00:00
LargeProgram_ZeroIterFor.skvm Enforce an upper bound on Runtime Effect program size. 2021-09-02 14:44:34 +00:00
LargeProgram_ZeroIterFor.stage Optimize away empty for loops. 2021-10-06 17:56:26 +00:00
LoopFloat.skvm Add trace coordinates to SkVMDebugInfo. 2021-11-17 21:56:42 +00:00
LoopFloat.stage Update LoopFloat/LoopInt tests to reduce hoisting. 2021-11-12 13:45:59 +00:00
LoopInt.skvm Add trace coordinates to SkVMDebugInfo. 2021-11-17 21:56:42 +00:00
LoopInt.stage Update LoopFloat/LoopInt tests to reduce hoisting. 2021-11-12 13:45:59 +00:00
PrecisionQualifiers.skvm Add trace coordinates to SkVMDebugInfo. 2021-11-17 21:56:42 +00:00
PrecisionQualifiers.stage Add variable slot information to SkVMDebugInfo. 2021-11-15 14:24:08 +00:00
QualifierOrder.skvm Emit qualifiers in the GLSL ES-required order. 2021-10-01 19:09:43 +00:00
QualifierOrder.stage Fix ES2 conformance test 'in_vs_no_in'. 2021-10-11 22:27:37 +00:00
SampleWithExplicitCoord.skvm
SampleWithExplicitCoord.stage Convert internal SkSL to use .eval() 2021-09-03 15:54:54 +00:00
Switch.skvm Run conditional-assignment loop forwards. 2021-09-24 13:04:42 +00:00
Switch.stage Implement switch in SkVM. 2021-09-23 19:58:55 +00:00
SwitchDefaultOnly.skvm Implement switch in SkVM. 2021-09-23 19:58:55 +00:00
SwitchDefaultOnly.stage Implement switch in SkVM. 2021-09-23 19:58:55 +00:00
SwitchWithFallthrough.skvm Implement switch in SkVM. 2021-09-23 19:58:55 +00:00
SwitchWithFallthrough.stage Emit prototypes in Pipeline for every defined function. 2021-09-30 21:37:26 +00:00
SwitchWithLoops.skvm Implement switch in SkVM. 2021-09-23 19:58:55 +00:00
SwitchWithLoops.stage Emit prototypes in Pipeline for every defined function. 2021-09-30 21:37:26 +00:00
VectorIndexing.skvm
VectorIndexing.stage Emit prototypes in Pipeline for every defined function. 2021-09-30 21:37:26 +00:00