提交 0a233c29 编写于 作者: W WANG Xuerui 提交者: Hongchen Zhang

LoongArch: Simplify "BLT foo, zero" with BLTZ

mainline inclusion
from mainline-v5.19
commit d1bc75d7
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5OHOB
CVE: NA

--------------------------------

Support for the syntactic sugar is present in upstream binutils port
from the beginning. Use it for shorter lines and better consistency.
Generated code should be identical.
Signed-off-by: NWANG Xuerui <git@xen0n.name>
Signed-off-by: NHuacai Chen <chenhuacai@loongson.cn>
上级 bafa6d80
...@@ -160,7 +160,7 @@ static inline int arch_atomic_sub_if_positive(int i, atomic_t *v) ...@@ -160,7 +160,7 @@ static inline int arch_atomic_sub_if_positive(int i, atomic_t *v)
"1: ll.w %1, %2 # atomic_sub_if_positive\n" "1: ll.w %1, %2 # atomic_sub_if_positive\n"
" addi.w %0, %1, %3 \n" " addi.w %0, %1, %3 \n"
" move %1, %0 \n" " move %1, %0 \n"
" blt %0, $zero, 2f \n" " bltz %0, 2f \n"
" sc.w %1, %2 \n" " sc.w %1, %2 \n"
" beqz %1, 1b \n" " beqz %1, 1b \n"
"2: \n" "2: \n"
...@@ -173,7 +173,7 @@ static inline int arch_atomic_sub_if_positive(int i, atomic_t *v) ...@@ -173,7 +173,7 @@ static inline int arch_atomic_sub_if_positive(int i, atomic_t *v)
"1: ll.w %1, %2 # atomic_sub_if_positive\n" "1: ll.w %1, %2 # atomic_sub_if_positive\n"
" sub.w %0, %1, %3 \n" " sub.w %0, %1, %3 \n"
" move %1, %0 \n" " move %1, %0 \n"
" blt %0, $zero, 2f \n" " bltz %0, 2f \n"
" sc.w %1, %2 \n" " sc.w %1, %2 \n"
" beqz %1, 1b \n" " beqz %1, 1b \n"
"2: \n" "2: \n"
...@@ -323,7 +323,7 @@ static inline long arch_atomic64_sub_if_positive(long i, atomic64_t *v) ...@@ -323,7 +323,7 @@ static inline long arch_atomic64_sub_if_positive(long i, atomic64_t *v)
"1: ll.d %1, %2 # atomic64_sub_if_positive \n" "1: ll.d %1, %2 # atomic64_sub_if_positive \n"
" addi.d %0, %1, %3 \n" " addi.d %0, %1, %3 \n"
" move %1, %0 \n" " move %1, %0 \n"
" blt %0, $zero, 2f \n" " bltz %0, 2f \n"
" sc.d %1, %2 \n" " sc.d %1, %2 \n"
" beqz %1, 1b \n" " beqz %1, 1b \n"
"2: \n" "2: \n"
...@@ -336,7 +336,7 @@ static inline long arch_atomic64_sub_if_positive(long i, atomic64_t *v) ...@@ -336,7 +336,7 @@ static inline long arch_atomic64_sub_if_positive(long i, atomic64_t *v)
"1: ll.d %1, %2 # atomic64_sub_if_positive \n" "1: ll.d %1, %2 # atomic64_sub_if_positive \n"
" sub.d %0, %1, %3 \n" " sub.d %0, %1, %3 \n"
" move %1, %0 \n" " move %1, %0 \n"
" blt %0, $zero, 2f \n" " bltz %0, 2f \n"
" sc.d %1, %2 \n" " sc.d %1, %2 \n"
" beqz %1, 1b \n" " beqz %1, 1b \n"
"2: \n" "2: \n"
......
...@@ -47,7 +47,7 @@ SYM_FUNC_START(handle_tlb_load) ...@@ -47,7 +47,7 @@ SYM_FUNC_START(handle_tlb_load)
* The vmalloc handling is not in the hotpath. * The vmalloc handling is not in the hotpath.
*/ */
csrrd t0, LOONGARCH_CSR_BADV csrrd t0, LOONGARCH_CSR_BADV
blt t0, zero, vmalloc_load bltz t0, vmalloc_load
csrrd t1, LOONGARCH_CSR_PGDL csrrd t1, LOONGARCH_CSR_PGDL
vmalloc_done_load: vmalloc_done_load:
...@@ -210,7 +210,7 @@ SYM_FUNC_START(handle_tlb_store) ...@@ -210,7 +210,7 @@ SYM_FUNC_START(handle_tlb_store)
* The vmalloc handling is not in the hotpath. * The vmalloc handling is not in the hotpath.
*/ */
csrrd t0, LOONGARCH_CSR_BADV csrrd t0, LOONGARCH_CSR_BADV
blt t0, zero, vmalloc_store bltz t0, vmalloc_store
csrrd t1, LOONGARCH_CSR_PGDL csrrd t1, LOONGARCH_CSR_PGDL
vmalloc_done_store: vmalloc_done_store:
...@@ -378,7 +378,7 @@ SYM_FUNC_START(handle_tlb_modify) ...@@ -378,7 +378,7 @@ SYM_FUNC_START(handle_tlb_modify)
* The vmalloc handling is not in the hotpath. * The vmalloc handling is not in the hotpath.
*/ */
csrrd t0, LOONGARCH_CSR_BADV csrrd t0, LOONGARCH_CSR_BADV
blt t0, zero, vmalloc_modify bltz t0, vmalloc_modify
csrrd t1, LOONGARCH_CSR_PGDL csrrd t1, LOONGARCH_CSR_PGDL
vmalloc_done_modify: vmalloc_done_modify:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册