projects
/
gcc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
re PR bootstrap/47055 ("make profiledbootstrap" fails on MSYS/mingw-w64)
[gcc.git]
/
libiberty
/
copysign.c
diff --git
a/libiberty/copysign.c
b/libiberty/copysign.c
index 0b5f8c3d9df866c5cc52ce0ad2ab8760aa72ba04..6793f22e8ccab04a257a0d26958ba5a1983dd0c2 100644
(file)
--- a/
libiberty/copysign.c
+++ b/
libiberty/copysign.c
@@
-129,8
+129,10
@@
typedef union
} __ieee_float_shape_type;
#endif
} __ieee_float_shape_type;
#endif
+#if defined(__IEEE_BIG_ENDIAN) || defined(__IEEE_LITTLE_ENDIAN)
-double DEFUN(copysign, (x, y), double x AND double y)
+double
+copysign (double x, double y)
{
__ieee_double_shape_type a,b;
b.value = y;
{
__ieee_double_shape_type a,b;
b.value = y;
@@
-138,3
+140,15
@@
double DEFUN(copysign, (x, y), double x AND double y)
a.number.sign =b.number.sign;
return a.value;
}
a.number.sign =b.number.sign;
return a.value;
}
+
+#else
+
+double
+copysign (double x, double y)
+{
+ if ((x < 0 && y > 0) || (x > 0 && y < 0))
+ return -x;
+ return x;
+}
+
+#endif