* @brief Return @c a with lanes negated if the @c b lane is negative. */
| 273 | * @brief Return @c a with lanes negated if the @c b lane is negative. |
| 274 | */ |
| 275 | ASTCENC_SIMD_INLINE vfloat change_sign(vfloat a, vfloat b) |
| 276 | { |
| 277 | vint ia = float_as_int(a); |
| 278 | vint ib = float_as_int(b); |
| 279 | vint sign_mask(static_cast<int>(0x80000000)); |
| 280 | vint r = ia ^ (ib & sign_mask); |
| 281 | return int_as_float(r); |
| 282 | } |
| 283 | |
| 284 | /** |
| 285 | * @brief Return fast, but approximate, vector atan(x). |