summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTanguy Pruvot <tanguy.pruvot@gmail.com>2011-08-11 04:48:29 +0200
committerTanguy Pruvot <tanguy.pruvot@gmail.com>2011-08-11 04:48:29 +0200
commit48303e96bc26c8e128e4c8a7992e174902855da3 (patch)
treeda2eb10a4dbf68547282e03349ac6b8db7e8af60
parent39368054d45a08776185e3541975e96d4f68ee79 (diff)
downloadbionic-48303e96bc26c8e128e4c8a7992e174902855da3.zip
bionic-48303e96bc26c8e128e4c8a7992e174902855da3.tar.gz
bionic-48303e96bc26c8e128e4c8a7992e174902855da3.tar.bz2
Enable use of clz instruction in ffs function for all ARMv5+
Enable use of faster code in ffs using clz instruction for other architectures than ARMv5. Also enables usage of ffs function in dlmalloc. Based on Change: Ifdc42db by c.bejram <christian.bejram@stericsson.com> Note: this ffs.S code is old, and the whole block could be deleted because android doesnt have support for ARMv4 SoCs Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>
-rw-r--r--libc/arch-arm/bionic/ffs.S2
-rw-r--r--libc/bionic/dlmalloc.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/libc/arch-arm/bionic/ffs.S b/libc/arch-arm/bionic/ffs.S
index f11141c..c7ffca2 100644
--- a/libc/arch-arm/bionic/ffs.S
+++ b/libc/arch-arm/bionic/ffs.S
@@ -47,7 +47,7 @@ ENTRY(ffs)
/* Standard trick to isolate bottom bit in r0 or 0 if r0 = 0 on entry */
rsb r1, r0, #0
ands r0, r0, r1
-#ifndef __ARM_ARCH_5__
+#if _ARM_ARCH_ < 5
/*
* now r0 has at most one set bit, call this X
* if X = 0, all further instructions are skipped
diff --git a/libc/bionic/dlmalloc.c b/libc/bionic/dlmalloc.c
index 19fbb75..559ccaf 100644
--- a/libc/bionic/dlmalloc.c
+++ b/libc/bionic/dlmalloc.c
@@ -465,6 +465,10 @@ DEFAULT_MMAP_THRESHOLD default: 256K
*/
+#ifdef ANDROID
+#define USE_BUILTIN_FFS 1
+#endif /* ANDROID */
+
#ifndef WIN32
#ifdef _WIN32
#define WIN32 1