+2018-01-23 Max Filippov <jcmvbkbc@gmail.com>
+
+ * config/xtensa/ieee754-df.S (__addsf3, __subsf3, __mulsf3)
+ (__divsf3): Make NaN return value quiet.
+ * config/xtensa/ieee754-sf.S (__adddf3, __subdf3, __muldf3)
+ (__divdf3): Make NaN return value quiet.
+
2018-01-22 Sebastian Perta <sebastian.perta@renesas.com>
* config/rl78/anddi3.S: New assembly file.
.Ladd_xnan_or_inf:
/* If y is neither Infinity nor NaN, return x. */
- bnall yh, a6, 1f
+ bnall yh, a6, .Ladd_return_nan_or_inf
/* If x is a NaN, return it. Otherwise, return y. */
slli a7, xh, 12
or a7, a7, xl
- beqz a7, .Ladd_ynan_or_inf
-1: leaf_return
+ bnez a7, .Ladd_return_nan
.Ladd_ynan_or_inf:
/* Return y. */
mov xh, yh
mov xl, yl
+
+.Ladd_return_nan_or_inf:
+ slli a7, xh, 12
+ or a7, a7, xl
+ bnez a7, .Ladd_return_nan
+ leaf_return
+
+.Ladd_return_nan:
+ movi a4, 0x80000 /* make it a quiet NaN */
+ or xh, xh, a4
leaf_return
.Ladd_opposite_signs:
.Lsub_xnan_or_inf:
/* If y is neither Infinity nor NaN, return x. */
- bnall yh, a6, 1f
+ bnall yh, a6, .Lsub_return_nan_or_inf
+
+.Lsub_return_nan:
/* Both x and y are either NaN or Inf, so the result is NaN. */
movi a4, 0x80000 /* make it a quiet NaN */
or xh, xh, a4
-1: leaf_return
+ leaf_return
.Lsub_ynan_or_inf:
/* Negate y and return it. */
slli a7, a6, 11
xor xh, yh, a7
mov xl, yl
+
+.Lsub_return_nan_or_inf:
+ slli a7, xh, 12
+ or a7, a7, xl
+ bnez a7, .Lsub_return_nan
leaf_return
.Lsub_opposite_signs:
/* If y is zero, return NaN. */
bnez yl, 1f
slli a8, yh, 1
- bnez a8, 1f
- movi a4, 0x80000 /* make it a quiet NaN */
- or xh, xh, a4
- j .Lmul_done
+ beqz a8, .Lmul_return_nan
1:
/* If y is NaN, return y. */
bnall yh, a6, .Lmul_returnx
mov xl, yl
.Lmul_returnx:
+ slli a8, xh, 12
+ or a8, a8, xl
+ bnez a8, .Lmul_return_nan
/* Set the sign bit and return. */
extui a7, a7, 31, 1
slli xh, xh, 1
bnez xl, .Lmul_returny
slli a8, xh, 1
bnez a8, .Lmul_returny
- movi a7, 0x80000 /* make it a quiet NaN */
- or xh, yh, a7
+ mov xh, yh
+
+.Lmul_return_nan:
+ movi a4, 0x80000 /* make it a quiet NaN */
+ or xh, xh, a4
j .Lmul_done
.align 4
slli a7, a7, 31
xor xh, xh, a7
/* If y is NaN or Inf, return NaN. */
- bnall yh, a6, 1f
- movi a4, 0x80000 /* make it a quiet NaN */
- or xh, xh, a4
-1: leaf_return
+ ball yh, a6, .Ldiv_return_nan
+ slli a8, xh, 12
+ or a8, a8, xl
+ bnez a8, .Ldiv_return_nan
+ leaf_return
.Ldiv_ynan_or_inf:
/* If y is Infinity, return zero. */
/* y is NaN; return it. */
mov xh, yh
mov xl, yl
+
+.Ldiv_return_nan:
+ movi a4, 0x80000 /* make it a quiet NaN */
+ or xh, xh, a4
leaf_return
.Ldiv_highequal1:
.Ladd_xnan_or_inf:
/* If y is neither Infinity nor NaN, return x. */
- bnall a3, a6, 1f
+ bnall a3, a6, .Ladd_return_nan_or_inf
/* If x is a NaN, return it. Otherwise, return y. */
slli a7, a2, 9
- beqz a7, .Ladd_ynan_or_inf
-1: leaf_return
+ bnez a7, .Ladd_return_nan
.Ladd_ynan_or_inf:
/* Return y. */
mov a2, a3
+
+.Ladd_return_nan_or_inf:
+ slli a7, a2, 9
+ bnez a7, .Ladd_return_nan
+ leaf_return
+
+.Ladd_return_nan:
+ movi a6, 0x400000 /* make it a quiet NaN */
+ or a2, a2, a6
leaf_return
.Ladd_opposite_signs:
.Lsub_xnan_or_inf:
/* If y is neither Infinity nor NaN, return x. */
- bnall a3, a6, 1f
+ bnall a3, a6, .Lsub_return_nan_or_inf
/* Both x and y are either NaN or Inf, so the result is NaN. */
+
+.Lsub_return_nan:
movi a4, 0x400000 /* make it a quiet NaN */
or a2, a2, a4
-1: leaf_return
+ leaf_return
.Lsub_ynan_or_inf:
/* Negate y and return it. */
slli a7, a6, 8
xor a2, a3, a7
+
+.Lsub_return_nan_or_inf:
+ slli a7, a2, 9
+ bnez a7, .Lsub_return_nan
leaf_return
.Lsub_opposite_signs:
.Lmul_xnan_or_inf:
/* If y is zero, return NaN. */
slli a8, a3, 1
- bnez a8, 1f
- movi a4, 0x400000 /* make it a quiet NaN */
- or a2, a2, a4
- j .Lmul_done
-1:
+ beqz a8, .Lmul_return_nan
/* If y is NaN, return y. */
bnall a3, a6, .Lmul_returnx
slli a8, a3, 9
mov a2, a3
.Lmul_returnx:
+ slli a8, a2, 9
+ bnez a8, .Lmul_return_nan
/* Set the sign bit and return. */
extui a7, a7, 31, 1
slli a2, a2, 1
/* If x is zero, return NaN. */
slli a8, a2, 1
bnez a8, .Lmul_returny
- movi a7, 0x400000 /* make it a quiet NaN */
- or a2, a3, a7
+ mov a2, a3
+
+.Lmul_return_nan:
+ movi a4, 0x400000 /* make it a quiet NaN */
+ or a2, a2, a4
j .Lmul_done
.align 4
slli a7, a7, 31
xor a2, a2, a7
/* If y is NaN or Inf, return NaN. */
- bnall a3, a6, 1f
- movi a4, 0x400000 /* make it a quiet NaN */
- or a2, a2, a4
-1: leaf_return
+ ball a3, a6, .Ldiv_return_nan
+ slli a7, a2, 9
+ bnez a7, .Ldiv_return_nan
+ leaf_return
.Ldiv_ynan_or_inf:
/* If y is Infinity, return zero. */
beqz a8, .Ldiv_return_zero
/* y is NaN; return it. */
mov a2, a3
+
+.Ldiv_return_nan:
+ movi a4, 0x400000 /* make it a quiet NaN */
+ or a2, a2, a4
leaf_return
.align 4