提交 360d7e48 编写于 作者: T tangyuxin

[libcpu][cm33] 修复不同优化等级,函数行为不一致的问题

上级 ef8b984f
......@@ -473,17 +473,13 @@ exit
#elif defined(__CLANG_ARM)
int __rt_ffs(int value)
{
__asm volatile(
"CMP r0, #0x00 \n"
"BEQ 1f \n"
if (value == 0) return value;
__asm volatile(
"RBIT r0, r0 \n"
"CLZ r0, r0 \n"
"ADDS r0, r0, #0x01 \n"
"1: \n"
"BX lr \n"
: "=r"(value)
: "r"(value)
);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册