diff options
| author | tangyuxin <[email protected]> | 2021-02-01 21:01:14 +0800 |
|---|---|---|
| committer | tangyuxin <[email protected]> | 2021-02-01 21:01:14 +0800 |
| commit | 360d7e48ab2d3c205b74523a075d92cbe3e72a7b (patch) | |
| tree | ae81fe9a5413cfcbea7755c73e63462ba36a1c4c /libcpu/arm | |
| parent | ef8b984fa1bf1ca0d90aab9404086e843fe352ae (diff) | |
[libcpu][cm33] 修复不同优化等级,函数行为不一致的问题
Diffstat (limited to 'libcpu/arm')
| -rw-r--r-- | libcpu/arm/cortex-m33/cpuport.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libcpu/arm/cortex-m33/cpuport.c b/libcpu/arm/cortex-m33/cpuport.c index 42b5798507..41325105d7 100644 --- a/libcpu/arm/cortex-m33/cpuport.c +++ b/libcpu/arm/cortex-m33/cpuport.c @@ -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) ); |
