summaryrefslogtreecommitdiff
path: root/lib/ucmpdi2.c
diff options
context:
space:
mode:
authorTim Northover <Tim.Northover@arm.com>2013-01-13 19:18:02 +0000
committerTim Northover <Tim.Northover@arm.com>2013-01-13 19:18:02 +0000
commit4785a776d09fb36bb2b162c3be40cd7ca017fce0 (patch)
tree30d34fe7e401b1cab9f1984e2d79007ec1a90723 /lib/ucmpdi2.c
parentedd477b676fa061cd795f411e0b452b3cb3c6940 (diff)
downloadcompiler-rt-4785a776d09fb36bb2b162c3be40cd7ca017fce0.tar.gz
compiler-rt-4785a776d09fb36bb2b162c3be40cd7ca017fce0.tar.bz2
compiler-rt-4785a776d09fb36bb2b162c3be40cd7ca017fce0.tar.xz
Implement __aeabi_lcmp and ulcmp
Patch contributed by Andrew Turner. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172366 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ucmpdi2.c')
-rw-r--r--lib/ucmpdi2.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/ucmpdi2.c b/lib/ucmpdi2.c
index 3242bbf0..40af2361 100644
--- a/lib/ucmpdi2.c
+++ b/lib/ucmpdi2.c
@@ -36,3 +36,16 @@ __ucmpdi2(du_int a, du_int b)
return 2;
return 1;
}
+
+#ifdef __ARM_EABI__
+/* Returns: if (a < b) returns -1
+* if (a == b) returns 0
+* if (a > b) returns 1
+*/
+COMPILER_RT_ABI si_int
+__aeabi_ulcmp(di_int a, di_int b)
+{
+ return __ucmpdi2(a, b) - 1;
+}
+#endif
+