diff --git a/arch/microblaze/lib/Makefile b/arch/microblaze/lib/Makefile index c13067b243c3925e486bef404a1ac80aba5ebc6a..844960e8ae189767f96eb5d2e6e79ed2ac3cab2e 100644 --- a/arch/microblaze/lib/Makefile +++ b/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/arch/microblaze/lib/cmpdi2.c b/arch/microblaze/lib/cmpdi2.c new file mode 100644 index 0000000000000000000000000000000000000000..a708400ea7b7ebb7a1cf238329200d8871e281ff --- /dev/null +++ b/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);