Builtin function __builtin_isfpclass now can be called for a vector
of floating-point values. In this case it is applied to the vector
elementwise and produces vector of boolean values.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This seems reasonable to me, but I do wonder if changing the return type from int to bool will cause surprises for anyone. I see why it's done, but this seems more like a C interface (to me) which would return an int; returning a bool gets promoted to int when you sneeze near it, so I wonder about performance implications. But at the same time, we wouldn't want a vector of ints returns in the vector case, I would suspect.
The new implementation uses the representation close to OpenCL, when it makes result of comparisons: https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_C.html#operators-relational. It is a vector of integers, where each element is of the same bit size as the source vector element. They must be already supported by the codegen.
Changes LGTM, but should come with a release note.
clang/docs/LanguageExtensions.rst | ||
---|---|---|
3543–3546 |