fix Issue 23568: Set the result type of vector comparisons to an integer vector type #14715
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The result of vector comparisons is a single or doubleword mask of all 1s (comparison true) or all 0s (comparison false). This SIMD mask type does not have an equivalent D type, however its closest equivalent would be an integer vector of the same unit size and length.
Rationale: Currently the result of vector float comparison and equality operations is either NaNs or 0s, which requires an explicit cast to a vector int in order to use it for checking the result post operation.
For example, GDC's ternary (
? :) vector intrinsicblendvectorcan work with the following:However if the condition is a vector float type...
This removes the need for such boilerplate.