[libcpu/arm/*/cpuport.c]fixed __rt_ffs bug on account of armclang LTO.

This commit is contained in:
xieyangrun 2020-06-18 09:18:48 +08:00
parent d7d6dbe774
commit d2eaa452d6
4 changed files with 8 additions and 8 deletions

View File

@ -388,13 +388,13 @@ int __rt_ffs(int value)
{ {
__asm volatile( __asm volatile(
"CMP r0, #0x00 \n" "CMP r0, #0x00 \n"
"BEQ exit \n" "BEQ 1f \n"
"RBIT r0, r0 \n" "RBIT r0, r0 \n"
"CLZ r0, r0 \n" "CLZ r0, r0 \n"
"ADDS r0, r0, #0x01 \n" "ADDS r0, r0, #0x01 \n"
"exit: \n" "1: \n"
: "=r"(value) : "=r"(value)
: "r"(value) : "r"(value)

View File

@ -475,13 +475,13 @@ int __rt_ffs(int value)
{ {
__asm volatile( __asm volatile(
"CMP r0, #0x00 \n" "CMP r0, #0x00 \n"
"BEQ exit \n" "BEQ 1f \n"
"RBIT r0, r0 \n" "RBIT r0, r0 \n"
"CLZ r0, r0 \n" "CLZ r0, r0 \n"
"ADDS r0, r0, #0x01 \n" "ADDS r0, r0, #0x01 \n"
"exit: \n" "1: \n"
"BX lr \n" "BX lr \n"
: "=r"(value) : "=r"(value)

View File

@ -472,13 +472,13 @@ int __rt_ffs(int value)
{ {
__asm volatile( __asm volatile(
"CMP r0, #0x00 \n" "CMP r0, #0x00 \n"
"BEQ exit \n" "BEQ 1f \n"
"RBIT r0, r0 \n" "RBIT r0, r0 \n"
"CLZ r0, r0 \n" "CLZ r0, r0 \n"
"ADDS r0, r0, #0x01 \n" "ADDS r0, r0, #0x01 \n"
"exit: \n" "1: \n"
: "=r"(value) : "=r"(value)
: "r"(value) : "r"(value)

View File

@ -472,13 +472,13 @@ int __rt_ffs(int value)
{ {
__asm volatile( __asm volatile(
"CMP r0, #0x00 \n" "CMP r0, #0x00 \n"
"BEQ exit \n" "BEQ 1f \n"
"RBIT r0, r0 \n" "RBIT r0, r0 \n"
"CLZ r0, r0 \n" "CLZ r0, r0 \n"
"ADDS r0, r0, #0x01 \n" "ADDS r0, r0, #0x01 \n"
"exit: \n" "1: \n"
: "=r"(value) : "=r"(value)
: "r"(value) : "r"(value)