我想做的(高级):在Android上使用qsort_r。
没有默认的实现。所以我从BSD上买了一个。不幸的是,它需要fls功能,这在Android上也是不可用的。因此,我抓取了Apple Open Source Libc库,并将ARM实现复制到内联程序集中。现在我得到了这个:
Assembler messages:
Error: selected processor does not support Thumb mode `clz r3,r0'
Error: cannot honor width suffix -- `rsb r0,r3,#32'AFAIR ARM-6在拇指模式下不支持它。那么,我如何才能对这一个文件强制非Thumb模式,或者是纯C实现可用于fls?
(天哪,为什么我必须玩这么低级的游戏才能有qsort_r...)
发布于 2013-09-16 22:53:02
在您的Android.mk文件中,这里介绍了如何设置以编译thumb、arm和neon版本的代码。汇编语言源文件在makefile中需要大写"S“,但实际名称不需要大写。后缀".arm“和".arm.neon”只存在于makefile中,而不是名称的一部分(例如,下面的文件分别命名为main.c、main_asm.s、test.c和test_asm.s)。
LOCAL_ARM_MODE := arm # remove this if you want thumb mode
LOCAL_ARM_NEON := true # remove this if you want armv5 mode
# this flag will allow neon intrinsics in your C files
LOCAL_CFLAGS := -mfpu=neon -march=armv7
LOCAL_SRC_FILES := \
main.c.arm \
test.c.arm.neon \
main_asm.S.arm \
test_asm.S.arm.neon \https://stackoverflow.com/questions/14033017
复制相似问题