* @brief Return the clamped value between min and max. * * It is assumed that neither @c min nor @c max are NaN values. If @c a is NaN * then @c min will be returned for that lane. */
| 743 | * then @c min will be returned for that lane. |
| 744 | */ |
| 745 | ASTCENC_SIMD_INLINE vfloat8 clamp(float min, float max, vfloat8 a) |
| 746 | { |
| 747 | // Do not reorder - second operand will return if either is NaN |
| 748 | a.m = _mm256_max_ps(a.m, _mm256_set1_ps(min)); |
| 749 | a.m = _mm256_min_ps(a.m, _mm256_set1_ps(max)); |
| 750 | return a; |
| 751 | } |
| 752 | |
| 753 | /** |
| 754 | * @brief Return a clamped value between 0.0f and 1.0f. |
nothing calls this directly
no outgoing calls
no test coverage detected