MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / change_sign

Function change_sign

Source/astcenc_vecmathlib.h:275–282  ·  view source on GitHub ↗

* @brief Return @c a with lanes negated if the @c b lane is negative. */

Source from the content-addressed store, hash-verified

273 * @brief Return @c a with lanes negated if the @c b lane is negative.
274 */
275ASTCENC_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).

Callers 3

atanFunction · 0.85
atan2Function · 0.85
TESTFunction · 0.85

Calls 2

float_as_intFunction · 0.70
int_as_floatFunction · 0.70

Tested by 1

TESTFunction · 0.68