summaryrefslogtreecommitdiff
path: root/05/tcc-0.9.27/lib
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-02-19 12:01:56 -0500
committerpommicket <pommicket@gmail.com>2022-02-19 12:01:56 -0500
commit9c6b9a1450d6610a37234b016bc1cfb021f30ee8 (patch)
tree9416b9c6b13b30f9107030cdccca7b33b1b27d60 /05/tcc-0.9.27/lib
parent59b7931165ecbd189214142b95d3d2033f4f579f (diff)
full build of tcc with itself - doesn't match gcc :o
Diffstat (limited to '05/tcc-0.9.27/lib')
-rw-r--r--05/tcc-0.9.27/lib/libtcc1.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/05/tcc-0.9.27/lib/libtcc1.c b/05/tcc-0.9.27/lib/libtcc1.c
index 0e46618..633696b 100644
--- a/05/tcc-0.9.27/lib/libtcc1.c
+++ b/05/tcc-0.9.27/lib/libtcc1.c
@@ -613,10 +613,17 @@ unsigned long long __fixunsxfdi (long double a1)
return 0;
}
+
+static long double negate_ld(long double d) {
+ register unsigned long long *p = (unsigned long long *)&d;
+ p[1] ^= 1ul<<15;
+ return *(long double *)p;
+}
+
long long __fixxfdi (long double a1)
{
long long ret; int s;
- ret = __fixunsxfdi((s = a1 >= 0) ? a1 : -a1);
+ ret = __fixunsxfdi((s = a1 >= 0) ? a1 : negate_ld(a1));
return s ? ret : -ret;
}
#endif /* !ARM */