* @brief Return lanes from @c b if MSB of @c cond is set, else @c a. */
| 707 | * @brief Return lanes from @c b if MSB of @c cond is set, else @c a. |
| 708 | */ |
| 709 | ASTCENC_SIMD_INLINE vint4 select(vint4 a, vint4 b, vmask4 cond) |
| 710 | { |
| 711 | return vint4((cond.m[0] & static_cast<int>(0x80000000)) ? b.m[0] : a.m[0], |
| 712 | (cond.m[1] & static_cast<int>(0x80000000)) ? b.m[1] : a.m[1], |
| 713 | (cond.m[2] & static_cast<int>(0x80000000)) ? b.m[2] : a.m[2], |
| 714 | (cond.m[3] & static_cast<int>(0x80000000)) ? b.m[3] : a.m[3]); |
| 715 | } |
| 716 | |
| 717 | // ============================================================================ |
| 718 | // vfloat4 operators and functions |