MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / HasFloatingPoint

Function HasFloatingPoint

source/opt/const_folding_rules.cpp:66–74  ·  view source on GitHub ↗

Returns true if |type| is Float or a vector of Float.

Source from the content-addressed store, hash-verified

64
65// Returns true if |type| is Float or a vector of Float.
66bool HasFloatingPoint(const analysis::Type* type) {
67 if (type->AsFloat()) {
68 return true;
69 } else if (const analysis::Vector* vec_type = type->AsVector()) {
70 return vec_type->element_type()->AsFloat() != nullptr;
71 }
72
73 return false;
74}
75
76// Returns a constants with the value |-val| of the given type. Only works for
77// 32-bit and 64-bit float point types. Returns |nullptr| if an error occurs.

Callers 4

FoldVectorTimesScalarFunction · 0.70
FoldTransposeFunction · 0.70
FoldVectorTimesMatrixFunction · 0.70
FoldMatrixTimesVectorFunction · 0.70

Calls 3

AsFloatMethod · 0.80
AsVectorMethod · 0.80
element_typeMethod · 0.45

Tested by

no test coverage detected