Skip to content

Commit 1fdb9a9

Browse files
xen0nchenhuacai
authored andcommitted
LoongArch: Simplify "BGT foo, zero" with BGTZ
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: WANG Xuerui <git@xen0n.name> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent d1bc75d commit 1fdb9a9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/loongarch/lib/clear_user.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ SYM_FUNC_START(__clear_user)
3232
1: st.b zero, a0, 0
3333
addi.d a0, a0, 1
3434
addi.d a1, a1, -1
35-
bgt a1, zero, 1b
35+
bgtz a1, 1b
3636

3737
2: move a0, a1
3838
jr ra

arch/loongarch/lib/copy_user.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ SYM_FUNC_START(__copy_user)
3535
addi.d a0, a0, 1
3636
addi.d a1, a1, 1
3737
addi.d a2, a2, -1
38-
bgt a2, zero, 1b
38+
bgtz a2, 1b
3939

4040
3: move a0, a2
4141
jr ra

0 commit comments

Comments
 (0)