do { \
_Static_assert (__builtin_types_compatible_p (typeof (retval), typeof (__ret))); \
__auto_type __cond = __builtin_convertvector ((cond), typeof (__mask)); \
- VECTOR_COND_MOVE (__ret, (retval), __cond); \
+ __auto_type __retval = (retval); \
+ VECTOR_COND_MOVE (__ret, __retval, __cond); \
__mask &= ~__cond; \
} while (0)
DEF_VD_MATH_PRED (v64si, ilogb, v64df x)
{
FUNCTION_INIT(v64si);
-
v64si hx, lx, ix;
EXTRACT_WORDS (hx, lx, x);
hx &= 0x7fffffff;
VECTOR_IF (hx < 0x00100000, cond)
- VECTOR_IF2 ((hx | lx) == 0, cond2, cond)
- VECTOR_RETURN (VECTOR_INIT (-__INT_MAX__), cond2); // FP_ILOGB0
- VECTOR_ELSE (cond2)
- VECTOR_IF2 (hx == 0, cond3, cond2)
- ix = VECTOR_INIT (-1043);
- for (v64si i = lx;
- !ALL_ZEROES_P (cond3 & (i > 0));
- i <<= 1)
- VECTOR_COND_MOVE (ix, ix - 1, cond3 & (i > 0));
- VECTOR_ELSE2 (cond3, cond2)
- ix = VECTOR_INIT (-1022);
- for (v64si i = (hx << 11);
- !ALL_ZEROES_P (cond3 & (i > 0));
- i <<= 1)
- VECTOR_COND_MOVE (ix, ix - 1, cond3 & (i > 0));
- VECTOR_ENDIF
+ VECTOR_RETURN (VECTOR_INIT (-__INT_MAX__), cond & ((hx | lx) == 0)); // FP_ILOGB0
+ VECTOR_IF2 (hx == 0, cond2, cond)
+ ix = VECTOR_INIT (-1043);
+ for (v64si i = lx;
+ !ALL_ZEROES_P (cond2 & (i > 0));
+ i <<= 1)
+ VECTOR_COND_MOVE (ix, ix - 1, cond2 & (i > 0));
+ VECTOR_ELSE2 (cond2, cond)
+ ix = VECTOR_INIT (-1022);
+ for (v64si i = (hx << 11);
+ !ALL_ZEROES_P (cond2 & (i > 0));
+ i <<= 1)
+ VECTOR_COND_MOVE (ix, ix - 1, cond2 & (i > 0));
VECTOR_ENDIF
VECTOR_RETURN (ix, cond);
VECTOR_ENDIF
- VECTOR_IF (hx < 0x7ff00000, cond)
- VECTOR_RETURN ((hx >> 20) - 1023, cond);
- VECTOR_ENDIF
+ VECTOR_RETURN ((hx >> 20) - 1023, hx < 0x7ff00000);
VECTOR_RETURN (VECTOR_INIT (__INT_MAX__), NO_COND);
FUNCTION_RETURN;