Commit 5eff6ca2 authored by Max Filippov's avatar Max Filippov

xtensa: use "m" constraint instead of "r" in futex.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: default avatarMax Filippov <jcmvbkbc@gmail.com>
parent cf3b3baa
...@@ -43,10 +43,10 @@ ...@@ -43,10 +43,10 @@
#elif XCHAL_HAVE_S32C1I #elif XCHAL_HAVE_S32C1I
#define __futex_atomic_op(insn, ret, old, uaddr, arg) \ #define __futex_atomic_op(insn, ret, old, uaddr, arg) \
__asm__ __volatile( \ __asm__ __volatile( \
"1: l32i %[oldval], %[addr], 0\n" \ "1: l32i %[oldval], %[mem]\n" \
insn "\n" \ insn "\n" \
" wsr %[oldval], scompare1\n" \ " wsr %[oldval], scompare1\n" \
"2: s32c1i %[newval], %[addr], 0\n" \ "2: s32c1i %[newval], %[mem]\n" \
" bne %[newval], %[oldval], 1b\n" \ " bne %[newval], %[oldval], 1b\n" \
" movi %[newval], 0\n" \ " movi %[newval], 0\n" \
"3:\n" \ "3:\n" \
...@@ -60,9 +60,9 @@ ...@@ -60,9 +60,9 @@
" .section __ex_table,\"a\"\n" \ " .section __ex_table,\"a\"\n" \
" .long 1b, 5b, 2b, 5b\n" \ " .long 1b, 5b, 2b, 5b\n" \
" .previous\n" \ " .previous\n" \
: [oldval] "=&r" (old), [newval] "=&r" (ret) \ : [oldval] "=&r" (old), [newval] "=&r" (ret), \
: [addr] "r" (uaddr), [oparg] "r" (arg), \ [mem] "+m" (*(uaddr)) \
[fault] "I" (-EFAULT) \ : [oparg] "r" (arg), [fault] "I" (-EFAULT) \
: "memory") : "memory")
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment