aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-08-11 11:56:15 +0000
committerNick Clifton <nickc@gcc.gnu.org>2010-08-11 11:56:15 +0000
commitbfd71bc196687fe20512c5936b2b509aaef9ff5f (patch)
treecd3f04fcd9783cffb23f49d2b8c97d33a4968e7a
parentc4aa95f8853f37cdc1d4d19ac4faa5d2dbbf2eb5 (diff)
downloadgcc-bfd71bc196687fe20512c5936b2b509aaef9ff5f.zip
gcc-bfd71bc196687fe20512c5936b2b509aaef9ff5f.tar.gz
gcc-bfd71bc196687fe20512c5936b2b509aaef9ff5f.tar.bz2
stormy16-lib2.c (__cmpsi2): New function.
* config/stormy16/stormy16-lib2.c (__cmpsi2): New function. * config/stormy16/stormy16-lib2-cmpsi2.c: New file. * config/stormy16/t-stormy16 (LIB2FUNCS_EXTRA): Add stormy16-lib2-cmpsi.c. * config/stormy16/t-stormy16 (TARGET_LIBGCC2_CFLAGS): Change to -O2. From-SVN: r163097
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/stormy16/stormy16-lib2-cmpsi2.c2
-rw-r--r--gcc/config/stormy16/stormy16-lib2.c23
-rw-r--r--gcc/config/stormy16/t-stormy163
4 files changed, 37 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ea4a0bb..92e6b58 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-11 Nick Clifton <nickc@redhat.com>
+
+ * config/stormy16/stormy16-lib2.c (__cmpsi2): New function.
+ * config/stormy16/stormy16-lib2-cmpsi2.c: New file.
+ * config/stormy16/t-stormy16 (LIB2FUNCS_EXTRA): Add
+ stormy16-lib2-cmpsi.c.
+
+ * config/stormy16/t-stormy16 (TARGET_LIBGCC2_CFLAGS): Change to
+ -O2.
+
2010-08-11 Joseph Myers <joseph@codesourcery.com>
* opts.h (struct cl_option_handler_func): Make handler take
diff --git a/gcc/config/stormy16/stormy16-lib2-cmpsi2.c b/gcc/config/stormy16/stormy16-lib2-cmpsi2.c
new file mode 100644
index 0000000..7563c36
--- /dev/null
+++ b/gcc/config/stormy16/stormy16-lib2-cmpsi2.c
@@ -0,0 +1,2 @@
+#define XSTORMY16_CMPSI2
+#include "stormy16-lib2.c"
diff --git a/gcc/config/stormy16/stormy16-lib2.c b/gcc/config/stormy16/stormy16-lib2.c
index edf8635..e3c1643 100644
--- a/gcc/config/stormy16/stormy16-lib2.c
+++ b/gcc/config/stormy16/stormy16-lib2.c
@@ -332,3 +332,26 @@ __ucmpsi2 (USItype a, USItype b)
return hi_a < hi_b ? 0 : 2;
}
#endif
+
+#ifdef XSTORMY16_CMPSI2
+/* Performs an signed comparison of two 32-bit values: A and B.
+ If A is less than B, then 0 is returned. If A is greater than B,
+ then 2 is returned. Otherwise A and B are equal and 1 is returned. */
+
+word_type
+__cmpsi2 (SItype a, SItype b)
+{
+ word_type hi_a = (a >> 16);
+ word_type hi_b = (b >> 16);
+
+ if (hi_a == hi_b)
+ {
+ word_type low_a = (a & 0xffff);
+ word_type low_b = (b & 0xffff);
+
+ return low_a < low_b ? 0 : (low_a > low_b ? 2 : 1);
+ }
+
+ return hi_a < hi_b ? 0 : 2;
+}
+#endif
diff --git a/gcc/config/stormy16/t-stormy16 b/gcc/config/stormy16/t-stormy16
index 7ca2635..62b4e9f 100644
--- a/gcc/config/stormy16/t-stormy16
+++ b/gcc/config/stormy16/t-stormy16
@@ -33,6 +33,7 @@ LIB2FUNCS_EXTRA = \
$(srcdir)/config/stormy16/stormy16-lib2-clzhi2.c \
$(srcdir)/config/stormy16/stormy16-lib2-ctzhi2.c \
$(srcdir)/config/stormy16/stormy16-lib2-ffshi2.c \
+ $(srcdir)/config/stormy16/stormy16-lib2-cmpsi2.c \
$(srcdir)/config/stormy16/stormy16-lib2-ucmpsi2.c
# Floating point emulation libraries.
@@ -46,4 +47,4 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
dp-bit.c: $(srcdir)/config/fp-bit.c
cat $(srcdir)/config/fp-bit.c > dp-bit.c
-TARGET_LIBGCC2_CFLAGS = -Os
+TARGET_LIBGCC2_CFLAGS = -O2