From 4cd0282700374ade880044991264ad7db08f9a54 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 29 Nov 2011 13:05:30 +0100 Subject: [PATCH] --- yaml --- r: 283154 b: refs/heads/master c: eecb20720f1b29019725515051e41bc7c079f91f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/microblaze/lib/Makefile | 1 + trunk/arch/microblaze/lib/cmpdi2.c | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 trunk/arch/microblaze/lib/cmpdi2.c diff --git a/[refs] b/[refs] index 8f1e095a2f97..d4168cca26e7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ed705633d3aba5ff442ca5b7a02bf19edfa811b5 +refs/heads/master: eecb20720f1b29019725515051e41bc7c079f91f diff --git a/trunk/arch/microblaze/lib/Makefile b/trunk/arch/microblaze/lib/Makefile index c13067b243c3..844960e8ae18 100644 --- a/trunk/arch/microblaze/lib/Makefile +++ b/trunk/arch/microblaze/lib/Makefile @@ -20,6 +20,7 @@ lib-y += uaccess_old.o lib-y += ashldi3.o lib-y += ashrdi3.o +lib-y += cmpdi2.o lib-y += divsi3.o lib-y += lshrdi3.o lib-y += modsi3.o diff --git a/trunk/arch/microblaze/lib/cmpdi2.c b/trunk/arch/microblaze/lib/cmpdi2.c new file mode 100644 index 000000000000..a708400ea7b7 --- /dev/null +++ b/trunk/arch/microblaze/lib/cmpdi2.c @@ -0,0 +1,26 @@ +#include + +#include "libgcc.h" + +word_type __cmpdi2(long long a, long long b) +{ + const DWunion au = { + .ll = a + }; + const DWunion bu = { + .ll = b + }; + + if (au.s.high < bu.s.high) + return 0; + else if (au.s.high > bu.s.high) + return 2; + + if ((unsigned int) au.s.low < (unsigned int) bu.s.low) + return 0; + else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) + return 2; + + return 1; +} +EXPORT_SYMBOL(__cmpdi2);