summaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2019-10-15 22:17:33 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2019-11-26 11:33:38 -0800
commit5bf67094a3a2d99d5f96db30be286f6c41988177 (patch)
tree78963be4370936d095943031ab745b22ad4a2017 /arch/xtensa
parente444917019258ef3bd564d0b4a432add2c26a2ae (diff)
downloadlinux-5bf67094a3a2d99d5f96db30be286f6c41988177.tar.bz2
xtensa: use "m" constraint instead of "a" in bitops.h assembly
Use "m" constraint instead of "r" for the address, as "m" allows compiler to access adjacent locations using base + offset, while "r" requires updating the base register every time. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/include/asm/bitops.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index 5a35d026c1c3..3f71d364ba90 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -150,13 +150,14 @@ static inline void op##_bit(unsigned int bit, volatile unsigned long *p)\
p += bit >> 5; \
\
__asm__ __volatile__( \
- "1: l32i %[value], %[addr], 0\n" \
+ "1: l32i %[value], %[mem]\n" \
" wsr %[value], scompare1\n" \
" "insn" %[tmp], %[value], %[mask]\n" \
- " s32c1i %[tmp], %[addr], 0\n" \
+ " s32c1i %[tmp], %[mem]\n" \
" bne %[tmp], %[value], 1b\n" \
- : [tmp] "=&a" (tmp), [value] "=&a" (value) \
- : [mask] "a" (inv mask), [addr] "a" (p) \
+ : [tmp] "=&a" (tmp), [value] "=&a" (value), \
+ [mem] "+m" (*p) \
+ : [mask] "a" (inv mask) \
: "memory"); \
}
@@ -170,13 +171,14 @@ test_and_##op##_bit(unsigned int bit, volatile unsigned long *p) \
p += bit >> 5; \
\
__asm__ __volatile__( \
- "1: l32i %[value], %[addr], 0\n" \
+ "1: l32i %[value], %[mem]\n" \
" wsr %[value], scompare1\n" \
" "insn" %[tmp], %[value], %[mask]\n" \
- " s32c1i %[tmp], %[addr], 0\n" \
+ " s32c1i %[tmp], %[mem]\n" \
" bne %[tmp], %[value], 1b\n" \
- : [tmp] "=&a" (tmp), [value] "=&a" (value) \
- : [mask] "a" (inv mask), [addr] "a" (p) \
+ : [tmp] "=&a" (tmp), [value] "=&a" (value), \
+ [mem] "+m" (*p) \
+ : [mask] "a" (inv mask) \
: "memory"); \
\
return tmp & mask; \