From b010e434ed3839e5064f7fc8337591a18d6b67cd Mon Sep 17 00:00:00 2001 From: JonasWen Date: Wed, 15 Jun 2022 17:19:51 +0800 Subject: [PATCH] =?UTF-8?q?[libcpu][arm]=20ArmClang=20=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF=20(#6071)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libcpu/arm/cortex-m4/cpuport.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libcpu/arm/cortex-m4/cpuport.c b/libcpu/arm/cortex-m4/cpuport.c index 6b748255c5..f060fa122d 100644 --- a/libcpu/arm/cortex-m4/cpuport.c +++ b/libcpu/arm/cortex-m4/cpuport.c @@ -15,6 +15,7 @@ * 2013-06-23 aozima support lazy stack optimized. * 2018-07-24 aozima enhancement hard fault exception handler. * 2019-07-03 yangjie add __rt_ffs() for armclang. + * 2022-06-12 jonas fixed __rt_ffs() for armclang. */ #include @@ -473,12 +474,12 @@ exit int __rt_ffs(int value) { __asm volatile( - "CMP r0, #0x00 \n" + "CMP %0, #0x00 \n" "BEQ 1f \n" - "RBIT r0, r0 \n" - "CLZ r0, r0 \n" - "ADDS r0, r0, #0x01 \n" + "RBIT %0, %0 \n" + "CLZ %0, %0 \n" + "ADDS %0, %0, #0x01 \n" "1: \n"