skia2/tests/sksl/intrinsics
John Stiles 721a07f5f6 Optimize away self comparisons in SPIR-V.
(This mirrors an optimization performed in the constant folder.)

Expressions like `OpIEqual %20 %20` or `OpFUnordNotEqual %15 %15` can be
replaced by `true` or `false` on sight. The GLSL spec makes it clear
that checking for NaN is optional:

4.7.1 Range and Precision
"... NaNs are not required to be generated. Support for signaling NaNs
is not required and exceptions are never raised. Operations and built-in
functions that operate on a NaN are not required to return a NaN as the
result."

Change-Id: I2e29b659a73582e9ade0eb61f70f7d362a007c50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531550
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-04-19 16:10:03 +00:00
..
AbsFloat.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
AbsFloat.glsl
AbsFloat.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
AbsInt.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
AbsInt.glsl
AbsInt.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Acos.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Acos.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Acos.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Acosh.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Acosh.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Acosh.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
All.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
All.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
All.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Any.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Any.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Any.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Asin.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Asin.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Asin.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Asinh.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Asinh.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Asinh.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Atan.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Atan.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Atan.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Atanh.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Atanh.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Atanh.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
BitCount.asm.frag
BitCount.glsl
BitCount.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Ceil.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
Ceil.glsl
Ceil.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
ClampFloat.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
ClampFloat.glsl Add missing intrinsic tests for abs/max/min(genIType), clamp(genType) 2022-02-04 14:42:17 +00:00
ClampFloat.metal Add missing intrinsic tests for abs/max/min(genIType), clamp(genType) 2022-02-04 14:42:17 +00:00
ClampInt.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
ClampInt.glsl
ClampInt.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
ClampUInt.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
ClampUInt.glsl Add support for clamp($genUType, ...) in SkSL. 2021-11-11 18:43:42 +00:00
ClampUInt.metal Add support for clamp($genUType, ...) in SkSL. 2021-11-11 18:43:42 +00:00
Cos.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Cos.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Cos.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Cosh.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Cosh.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Cosh.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Cross.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Cross.glsl
Cross.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
CrossNoInline.asm.frag Use op cache for pointer and function types. 2022-04-14 13:00:27 +00:00
CrossNoInline.glsl Rename SkSL's 2D cross product builtin function 2021-12-14 22:00:26 +00:00
CrossNoInline.metal Rename SkSL's 2D cross product builtin function 2021-12-14 22:00:26 +00:00
Degrees.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Degrees.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Degrees.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Determinant.asm.frag
Determinant.glsl
Determinant.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
DFdx.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
DFdx.glsl
DFdx.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
DFdy.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
DFdy.glsl Wrap 'u_rtFlip.y * dfdy()' in parentheses, in GLSL. 2021-10-29 14:03:35 +00:00
DFdy.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
DFdyNoRTFlip.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
DFdyNoRTFlip.glsl SkSL: Add unit tests for new ForceNoRTFlip code-gen option 2022-04-15 12:59:07 +00:00
DFdyNoRTFlip.metal SkSL: Add unit tests for new ForceNoRTFlip code-gen option 2022-04-15 12:59:07 +00:00
Distance.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
Distance.glsl
Distance.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Dot.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
Dot.glsl
Dot.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Equal.asm.frag Fix incorrect assertion discovered by fuzzer. 2021-10-04 13:41:56 +00:00
Equal.glsl Fix incorrect assertion discovered by fuzzer. 2021-10-04 13:41:56 +00:00
Equal.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Exp2.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Exp2.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Exp2.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Exp.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Exp.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Exp.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
FaceForward.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
FaceForward.glsl
FaceForward.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
FindLSB.asm.frag
FindLSB.glsl
FindLSB.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
FindMSB.asm.frag
FindMSB.glsl
FindMSB.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
FloatBitsToInt.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
FloatBitsToInt.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
FloatBitsToInt.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
FloatBitsToUint.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
FloatBitsToUint.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
FloatBitsToUint.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Floor.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
Floor.glsl
Floor.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Fma.asm.frag
Fma.glsl
Fma.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Fract.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Fract.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Fract.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Frexp.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Frexp.glsl
Frexp.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Fwidth.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Fwidth.glsl Add fwidth intrinsic to public SkSL in ES3. 2021-09-16 01:56:32 +00:00
Fwidth.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
GreaterThan.asm.frag
GreaterThan.glsl
GreaterThan.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
GreaterThanEqual.asm.frag
GreaterThanEqual.glsl
GreaterThanEqual.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
IntBitsToFloat.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
IntBitsToFloat.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
IntBitsToFloat.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Inverse.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Inverse.glsl
Inverse.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Inversesqrt.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Inversesqrt.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Inversesqrt.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
IsInf.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
IsInf.glsl
IsInf.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
IsNan.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
IsNan.glsl
IsNan.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Ldexp.asm.frag
Ldexp.glsl
Ldexp.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Length.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
Length.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Length.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
LessThan.asm.frag
LessThan.glsl
LessThan.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
LessThanEqual.asm.frag
LessThanEqual.glsl
LessThanEqual.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Log2.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Log2.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Log2.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Log.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Log.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Log.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
MatrixCompMultES2.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
MatrixCompMultES2.glsl
MatrixCompMultES2.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
MatrixCompMultES3.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
MatrixCompMultES3.glsl Revert "Disallow matrix ctors which overflow a column." 2021-10-14 01:30:08 +00:00
MatrixCompMultES3.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
MaxFloat.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
MaxFloat.glsl
MaxFloat.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
MaxInt.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
MaxInt.glsl
MaxInt.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
MinFloat.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
MinFloat.glsl
MinFloat.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
MinInt.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
MinInt.glsl
MinInt.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
MixBool.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
MixBool.glsl
MixBool.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
MixFloat.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
MixFloat.glsl
MixFloat.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Mod.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
Mod.glsl
Mod.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Modf.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Modf.glsl
Modf.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Normalize.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
Normalize.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Normalize.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Not.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Not.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Not.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
NotEqual.asm.frag Use unordered comparisons for != in SPIR-V. 2022-02-25 22:22:43 +00:00
NotEqual.glsl
NotEqual.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
OuterProduct.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
OuterProduct.glsl
OuterProduct.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Pack.asm.frag
Pack.glsl
Pack.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
PackUnorm2x16.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
PackUnorm2x16.glsl
PackUnorm2x16.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Pow.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Pow.glsl
Pow.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Radians.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Radians.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Radians.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Reflect.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
Reflect.glsl
Reflect.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Refract.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Refract.glsl
Refract.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Round.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Round.glsl
Round.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
RoundEven.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
RoundEven.glsl
RoundEven.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Saturate.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
Saturate.glsl
Saturate.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
SignFloat.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
SignFloat.glsl
SignFloat.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
SignInt.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
SignInt.glsl
SignInt.metal Implement Metal polyfill for sign(genIType). 2022-02-03 15:21:03 +00:00
Sin.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Sin.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Sin.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Sinh.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Sinh.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Sinh.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Smoothstep.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
Smoothstep.glsl
Smoothstep.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Sqrt.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Sqrt.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Sqrt.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Step.asm.frag Optimize away self comparisons in SPIR-V. 2022-04-19 16:10:03 +00:00
Step.glsl
Step.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Tan.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Tan.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Tan.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Tanh.asm.frag Replace scalar/vector ID caches with op cache. 2022-04-12 21:33:50 +00:00
Tanh.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
Tanh.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Transpose.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Transpose.glsl
Transpose.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Trunc.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
Trunc.glsl
Trunc.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
UintBitsToFloat.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
UintBitsToFloat.glsl Rename variables named input in test files. 2021-09-30 16:39:21 +00:00
UintBitsToFloat.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00
Unpack.asm.frag
Unpack.glsl
Unpack.metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +00:00