提交 277c8cb3 编写于 作者: H Huang Pei 提交者: Thomas Bogendoerfer

MIPS: fix local_{add,sub}_return on MIPS64

Use "daddu/dsubu" for long int on MIPS64 instead of "addu/subu"

Fixes: 7232311e ("local_t: mips extension")
Signed-off-by: NHuang Pei <huangpei@loongson.cn>
Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
上级 6bcfdc49
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <linux/percpu.h> #include <linux/percpu.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <asm/asm.h>
#include <asm/cmpxchg.h> #include <asm/cmpxchg.h>
#include <asm/compiler.h> #include <asm/compiler.h>
#include <asm/war.h> #include <asm/war.h>
...@@ -39,7 +40,7 @@ static __inline__ long local_add_return(long i, local_t * l) ...@@ -39,7 +40,7 @@ static __inline__ long local_add_return(long i, local_t * l)
" .set arch=r4000 \n" " .set arch=r4000 \n"
__SYNC(full, loongson3_war) " \n" __SYNC(full, loongson3_war) " \n"
"1:" __LL "%1, %2 # local_add_return \n" "1:" __LL "%1, %2 # local_add_return \n"
" addu %0, %1, %3 \n" __stringify(LONG_ADDU) " %0, %1, %3 \n"
__SC "%0, %2 \n" __SC "%0, %2 \n"
" beqzl %0, 1b \n" " beqzl %0, 1b \n"
" addu %0, %1, %3 \n" " addu %0, %1, %3 \n"
...@@ -55,7 +56,7 @@ static __inline__ long local_add_return(long i, local_t * l) ...@@ -55,7 +56,7 @@ static __inline__ long local_add_return(long i, local_t * l)
" .set "MIPS_ISA_ARCH_LEVEL" \n" " .set "MIPS_ISA_ARCH_LEVEL" \n"
__SYNC(full, loongson3_war) " \n" __SYNC(full, loongson3_war) " \n"
"1:" __LL "%1, %2 # local_add_return \n" "1:" __LL "%1, %2 # local_add_return \n"
" addu %0, %1, %3 \n" __stringify(LONG_ADDU) " %0, %1, %3 \n"
__SC "%0, %2 \n" __SC "%0, %2 \n"
" beqz %0, 1b \n" " beqz %0, 1b \n"
" addu %0, %1, %3 \n" " addu %0, %1, %3 \n"
...@@ -88,7 +89,7 @@ static __inline__ long local_sub_return(long i, local_t * l) ...@@ -88,7 +89,7 @@ static __inline__ long local_sub_return(long i, local_t * l)
" .set arch=r4000 \n" " .set arch=r4000 \n"
__SYNC(full, loongson3_war) " \n" __SYNC(full, loongson3_war) " \n"
"1:" __LL "%1, %2 # local_sub_return \n" "1:" __LL "%1, %2 # local_sub_return \n"
" subu %0, %1, %3 \n" __stringify(LONG_SUBU) " %0, %1, %3 \n"
__SC "%0, %2 \n" __SC "%0, %2 \n"
" beqzl %0, 1b \n" " beqzl %0, 1b \n"
" subu %0, %1, %3 \n" " subu %0, %1, %3 \n"
...@@ -104,7 +105,7 @@ static __inline__ long local_sub_return(long i, local_t * l) ...@@ -104,7 +105,7 @@ static __inline__ long local_sub_return(long i, local_t * l)
" .set "MIPS_ISA_ARCH_LEVEL" \n" " .set "MIPS_ISA_ARCH_LEVEL" \n"
__SYNC(full, loongson3_war) " \n" __SYNC(full, loongson3_war) " \n"
"1:" __LL "%1, %2 # local_sub_return \n" "1:" __LL "%1, %2 # local_sub_return \n"
" subu %0, %1, %3 \n" __stringify(LONG_SUBU) " %0, %1, %3 \n"
__SC "%0, %2 \n" __SC "%0, %2 \n"
" beqz %0, 1b \n" " beqz %0, 1b \n"
" subu %0, %1, %3 \n" " subu %0, %1, %3 \n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册