MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / sseSelect

Function sseSelect

src/OpenColorIO/SSE.h:149–156  ·  view source on GitHub ↗

Bit-wise select function in SSE version 2 Return the parameter arg_false bit where the parameter mask is 0x0, return the parameter arg_true bit where the mask is 1. Algorithm Explanation: Uses the identities: x XOR 0 = x x XOR x = 0 select = ((arg_true XOR arg_false) AND mask) XOR arg_false When mask = 0, the expression evaluates to: = ((arg_true XOR arg_false) AND 0x0) XOR arg_false = 0x0 XO

Source from the content-addressed store, hash-verified

147// solution requires two registers.
148//
149inline __m128 sseSelect(const __m128& mask, const __m128& arg_true, const __m128& arg_false)
150{
151 return _mm_xor_ps( // bit-wise XOR of arg_false, (...)
152 arg_false,
153 _mm_and_ps( // bit-wise AND of mask, (...)
154 mask,
155 _mm_xor_ps( arg_true, arg_false ) ) ); // bit-wise XOR of arg_true, arg_false
156}
157
158// Coefficients of Chebyshev (minimax) degree 5 polynomial
159// approximation to log2() over the range [1.0, 2.0[.

Callers 4

sseExp2Function · 0.85
sseAtanFunction · 0.85
sseSinCosFunction · 0.85
ApplyPower<false>Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected