Commit 41b93b23 authored by Bharat Bhushan's avatar Bharat Bhushan Committed by Benjamin Herrenschmidt

powerpc: Added __cmpdi2 for signed 64bit comparision

This was missing on powerpc and I am getting compilation error
drivers/vfio/pci/vfio_pci_rdwr.c:193: undefined reference to `__cmpdi2'
drivers/vfio/pci/vfio_pci_rdwr.c:193: undefined reference to `__cmpdi2'
Signed-off-by: default avatarBharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 8616dff5
...@@ -658,6 +658,20 @@ _GLOBAL(__lshrdi3) ...@@ -658,6 +658,20 @@ _GLOBAL(__lshrdi3)
or r4,r4,r7 # LSW |= t2 or r4,r4,r7 # LSW |= t2
blr blr
/*
* 64-bit comparison: __cmpdi2(s64 a, s64 b)
* Returns 0 if a < b, 1 if a == b, 2 if a > b.
*/
_GLOBAL(__cmpdi2)
cmpw r3,r5
li r3,1
bne 1f
cmplw r4,r6
beqlr
1: li r3,0
bltlr
li r3,2
blr
/* /*
* 64-bit comparison: __ucmpdi2(u64 a, u64 b) * 64-bit comparison: __ucmpdi2(u64 a, u64 b)
* Returns 0 if a < b, 1 if a == b, 2 if a > b. * Returns 0 if a < b, 1 if a == b, 2 if a > b.
......
...@@ -145,6 +145,8 @@ EXPORT_SYMBOL(__ashldi3); ...@@ -145,6 +145,8 @@ EXPORT_SYMBOL(__ashldi3);
EXPORT_SYMBOL(__lshrdi3); EXPORT_SYMBOL(__lshrdi3);
int __ucmpdi2(unsigned long long, unsigned long long); int __ucmpdi2(unsigned long long, unsigned long long);
EXPORT_SYMBOL(__ucmpdi2); EXPORT_SYMBOL(__ucmpdi2);
int __cmpdi2(long long, long long);
EXPORT_SYMBOL(__cmpdi2);
#endif #endif
long long __bswapdi2(long long); long long __bswapdi2(long long);
EXPORT_SYMBOL(__bswapdi2); EXPORT_SYMBOL(__bswapdi2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment