From 360d7e48ab2d3c205b74523a075d92cbe3e72a7b Mon Sep 17 00:00:00 2001 From: tangyuxin Date: Mon, 1 Feb 2021 21:01:14 +0800 Subject: [PATCH] =?UTF-8?q?[libcpu][cm33]=20=E4=BF=AE=E5=A4=8D=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E4=BC=98=E5=8C=96=E7=AD=89=E7=BA=A7=EF=BC=8C=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E8=A1=8C=E4=B8=BA=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libcpu/arm/cortex-m33/cpuport.c | 8 ++------ 1 file 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) );