Returns true if |type| is Float or a vector of Float.
| 64 | |
| 65 | // Returns true if |type| is Float or a vector of Float. |
| 66 | bool 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. |
no test coverage detected