summaryrefslogtreecommitdiffstats
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
commit754d1e4932a1202bc9d3dadefac58ac125357c29 (patch)
tree6c6de2c712d254a41e3b1e32d780bdd660ec857a
parent0d8c9ca7e64d5713e65f4ad710dd5f326c28cf58 (diff)
downloadbcm5719-llvm-754d1e4932a1202bc9d3dadefac58ac125357c29.tar.gz
bcm5719-llvm-754d1e4932a1202bc9d3dadefac58ac125357c29.zip
Implement __aeabi_lcmp and ulcmp
Patch contributed by Andrew Turner. llvm-svn: 172366
-rw-r--r--compiler-rt/lib/cmpdi2.c13
-rw-r--r--compiler-rt/lib/ucmpdi2.c13
2 files changed, 26 insertions, 0 deletions
diff --git a/compiler-rt/lib/cmpdi2.c b/compiler-rt/lib/cmpdi2.c
index c2b1f69f4fc..52634d9c336 100644
--- a/compiler-rt/lib/cmpdi2.c
+++ b/compiler-rt/lib/cmpdi2.c
@@ -36,3 +36,16 @@ __cmpdi2(di_int a, di_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_lcmp(di_int a, di_int b)
+{
+ return __cmpdi2(a, b) - 1;
+}
+#endif
+
diff --git a/compiler-rt/lib/ucmpdi2.c b/compiler-rt/lib/ucmpdi2.c
index 3242bbf0804..40af23613b1 100644
--- a/compiler-rt/lib/ucmpdi2.c
+++ b/compiler-rt/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
+
OpenPOWER on IntegriCloud