+2022-11-07 Kwok Cheung Yeung <kcy@codesourcery.com>
+
+ * config/gcn/simd-math/v64df_rint.c (rint): Simplified. Fixed bug in
+ nested VECTOR_IF. Fixed issue with signed right-shift.
+ * config/gcn/simd-math/v64sf_rint.c (rintf): Simplified. Fixed bug in
+ nested VECTOR_IF.
+
2022-11-01 Kwok Cheung Yeung <kcy@codesourcery.com>
Paul-Antoine Arras <pa@codesourcery.com>
Andrew Jenner <andrew@codesourcery.com>
GET_HIGH_WORD (i0, t, cond2);
SET_HIGH_WORD (t, (i0&0x7fffffff)|(sx<<31), cond2);
VECTOR_RETURN (t, cond2);
- VECTOR_ELSE (cond2)
+ VECTOR_ELSE2 (cond2, cond)
i = (0x000fffff) >> j0;
VECTOR_RETURN (x, cond2 & (((i0 & i) | i1) == 0)); /* x is integral */
i >>= 1;
VECTOR_RETURN (x + x, cond & (j0 == 0x400));
VECTOR_RETURN (x, cond);
VECTOR_ELSE (cond)
- i = (0xffffffff) >> (j0 - 20);
+ i = CAST_VECTOR (v64si, VECTOR_INIT (0xffffffff) >> (j0 - 20));
VECTOR_RETURN (x, cond & ((i1 & i) == 0));
i >>= 1;
VECTOR_COND_MOVE (i1, (i1 & (~i)) | (0x40000000 >> (j0 - 20)), cond & ((i1 & i) != 0));
v64si ix = (i0 & 0x7fffffff);
v64si j0 = (ix >> 23) - 0x7f;
VECTOR_IF (j0 < 23, cond)
- VECTOR_IF2 (FLT_UWORD_IS_ZERO (ix), cond2, cond)
- VECTOR_RETURN (x, cond2);
- VECTOR_ENDIF
+ VECTOR_RETURN (x, cond & FLT_UWORD_IS_ZERO (ix));
VECTOR_IF2 (j0 < 0, cond2, cond)
v64si i1 = (i0 & 0x07fffff);
VECTOR_COND_MOVE (i0, i0 & 0xfff00000, cond2);
GET_FLOAT_WORD (i0, t, cond2);
SET_FLOAT_WORD (t, (i0&0x7fffffff)|(sx<<31), cond2);
VECTOR_RETURN (t, cond2);
- VECTOR_ELSE (cond2)
+ VECTOR_ELSE2 (cond2, cond)
v64si i = (0x007fffff) >> j0;
- VECTOR_IF2 ((i0 & i) == 0, cond3, cond2) /* x is integral */
- VECTOR_RETURN (x, cond3);
- VECTOR_ENDIF
+ VECTOR_RETURN (x, cond2 & ((i0 & i) == 0)); /* x is integral */
i >>= 1;
- VECTOR_IF2 ((i0 & i) != 0, cond3, cond2)
- VECTOR_COND_MOVE (i0, (i0 & (~i)) | ((0x200000) >> j0), cond3);
- VECTOR_ENDIF
+ VECTOR_COND_MOVE (i0, (i0 & (~i)) | (0x200000 >> j0),
+ cond2 & ((i0 & i) != 0));
VECTOR_ENDIF
VECTOR_ELSE (cond)
- VECTOR_IF2 (~FLT_UWORD_IS_FINITE (ix), cond2, cond) /* inf or NaN */
- VECTOR_RETURN (x + x, cond2);
- VECTOR_ELSE (cond2) /* x is integral */
- VECTOR_RETURN (x, cond2);
- VECTOR_ENDIF
+ VECTOR_RETURN (x + x, cond & ~FLT_UWORD_IS_FINITE (ix)); /* inf or NaN */
+ VECTOR_RETURN (x, cond); /* x is integral */
VECTOR_ENDIF
SET_FLOAT_WORD (x, i0, NO_COND);