Skip to content

Commit 21ee452

Browse files
tfx2001mysterywolf
authored andcommitted
[libcpu][arm] fix armclang error when enable LTO
1 parent 1f134b8 commit 21ee452

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

libcpu/arm/cortex-m3/cpuport.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,12 @@ exit
389389
int __rt_ffs(int value)
390390
{
391391
__asm volatile(
392-
"CMP r0, #0x00 \n"
392+
"CMP %1, #0x00 \n"
393393
"BEQ 1f \n"
394394

395-
"RBIT r0, r0 \n"
396-
"CLZ r0, r0 \n"
397-
"ADDS r0, r0, #0x01 \n"
395+
"RBIT %1, %1 \n"
396+
"CLZ %0, %1 \n"
397+
"ADDS %0, %0, #0x01 \n"
398398

399399
"1: \n"
400400

libcpu/arm/cortex-m4/cpuport.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,11 @@ exit
474474
int __rt_ffs(int value)
475475
{
476476
__asm volatile(
477-
"CMP %0, #0x00 \n"
477+
"CMP %1, #0x00 \n"
478478
"BEQ 1f \n"
479479

480-
"RBIT %0, %0 \n"
481-
"CLZ %0, %0 \n"
480+
"RBIT %1, %1 \n"
481+
"CLZ %0, %1 \n"
482482
"ADDS %0, %0, #0x01 \n"
483483

484484
"1: \n"

libcpu/arm/cortex-m7/cpuport.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,12 +473,12 @@ exit
473473
int __rt_ffs(int value)
474474
{
475475
__asm volatile(
476-
"CMP r0, #0x00 \n"
476+
"CMP %1, #0x00 \n"
477477
"BEQ 1f \n"
478478

479-
"RBIT r0, r0 \n"
480-
"CLZ r0, r0 \n"
481-
"ADDS r0, r0, #0x01 \n"
479+
"RBIT %1, %1 \n"
480+
"CLZ %0, %1 \n"
481+
"ADDS %0, %0, #0x01 \n"
482482

483483
"1: \n"
484484

0 commit comments

Comments
 (0)