Skip to content

Commit df6b106

Browse files
Thiemo Seuferralfbaechle
authored andcommitted
[MIPS] Add __ucmpdi2 implementation
Recent GCC SVN versions may generate calls to __ucmpdi2. Signed-off-by: Thiemo Seufer <ths@networkno.de> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 774583f commit df6b106

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

‎arch/mips/lib/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ obj-y += iomap.o
99
obj-$(CONFIG_PCI) += iomap-pci.o
1010

1111
# libgcc-style stuff needed in the kernel
12-
lib-y += ashldi3.o ashrdi3.o lshrdi3.o
12+
lib-y += ashldi3.o ashrdi3.o lshrdi3.o ucmpdi2.o

‎arch/mips/lib/ucmpdi2.c‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <linux/module.h>
2+
3+
#include "libgcc.h"
4+
5+
word_type __ucmpdi2 (unsigned long a, unsigned long b)
6+
{
7+
const DWunion au = {.ll = a};
8+
const DWunion bu = {.ll = b};
9+
10+
if ((unsigned int) au.s.high < (unsigned int) bu.s.high)
11+
return 0;
12+
else if ((unsigned int) au.s.high > (unsigned int) bu.s.high)
13+
return 2;
14+
if ((unsigned int) au.s.low < (unsigned int) bu.s.low)
15+
return 0;
16+
else if ((unsigned int) au.s.low > (unsigned int) bu.s.low)
17+
return 2;
18+
return 1;
19+
}

0 commit comments

Comments
 (0)