summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/config/fixunsdfsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/config/fixunsdfsi.c')
-rw-r--r--contrib/gcc/config/fixunsdfsi.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/gcc/config/fixunsdfsi.c b/contrib/gcc/config/fixunsdfsi.c
new file mode 100644
index 0000000..fe7a4f8
--- /dev/null
+++ b/contrib/gcc/config/fixunsdfsi.c
@@ -0,0 +1,18 @@
+/* Public domain. */
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef int SItype __attribute__ ((mode (SI)));
+typedef float SFtype __attribute__ ((mode (SF)));
+typedef float DFtype __attribute__ ((mode (DF)));
+
+USItype __fixunsdfsi (DFtype);
+
+#define SItype_MIN \
+ (- ((SItype) (((USItype) 1 << ((sizeof (SItype) * 8) - 1)) - 1)) - 1)
+
+USItype
+__fixunsdfsi (DFtype a)
+{
+ if (a >= - (DFtype) SItype_MIN)
+ return (SItype) (a + SItype_MIN) - SItype_MIN;
+ return (SItype) a;
+}
OpenPOWER on IntegriCloud