diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2021-03-22 16:08:39 +0300 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2021-04-12 13:46:43 +0300 |
commit | ca897bb1814fc77ce2ded7b31350ff2b25ccb0a4 (patch) | |
tree | 7bce1129bbca8e91d11adc4fbf28ece4a8bac637 /arch/s390/include | |
parent | c8a91c285d8c3449b32021b28bcb7fb5662403a8 (diff) | |
download | linux-ca897bb1814fc77ce2ded7b31350ff2b25ccb0a4.tar.xz |
s390/atomic: use proper constraints
Use the R,T, and S constraints instead of the Q constraint in atomic
inline assemblies wherever possible. This allows the compiler to
generate better code. (~ -2kb code size).
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/atomic_ops.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/s390/include/asm/atomic_ops.h b/arch/s390/include/asm/atomic_ops.h index 82ed50885558..92ea9d9a2b93 100644 --- a/arch/s390/include/asm/atomic_ops.h +++ b/arch/s390/include/asm/atomic_ops.h @@ -14,7 +14,7 @@ static inline int __atomic_read(const atomic_t *v) asm volatile( " l %0,%1\n" - : "=d" (c) : "Q" (v->counter)); + : "=d" (c) : "R" (v->counter)); return c; } @@ -22,7 +22,7 @@ static inline void __atomic_set(atomic_t *v, int i) { asm volatile( " st %1,%0\n" - : "=Q" (v->counter) : "d" (i)); + : "=R" (v->counter) : "d" (i)); } static inline s64 __atomic64_read(const atomic64_t *v) @@ -31,7 +31,7 @@ static inline s64 __atomic64_read(const atomic64_t *v) asm volatile( " lg %0,%1\n" - : "=d" (c) : "Q" (v->counter)); + : "=d" (c) : "T" (v->counter)); return c; } @@ -39,7 +39,7 @@ static inline void __atomic64_set(atomic64_t *v, s64 i) { asm volatile( " stg %1,%0\n" - : "=Q" (v->counter) : "d" (i)); + : "=T" (v->counter) : "d" (i)); } #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES @@ -52,7 +52,7 @@ static inline op_type op_name(op_type val, op_type *ptr) \ asm volatile( \ op_string " %[old],%[val],%[ptr]\n" \ op_barrier \ - : [old] "=d" (old), [ptr] "+Q" (*ptr) \ + : [old] "=d" (old), [ptr] "+S" (*ptr) \ : [val] "d" (val) : "cc", "memory"); \ return old; \ } \ @@ -80,7 +80,7 @@ static __always_inline void op_name(op_type val, op_type *ptr) \ asm volatile( \ op_string " %[ptr],%[val]\n" \ op_barrier \ - : [ptr] "+Q" (*ptr) : [val] "i" (val) : "cc", "memory");\ + : [ptr] "+S" (*ptr) : [val] "i" (val) : "cc", "memory");\ } #define __ATOMIC_CONST_OPS(op_name, op_type, op_string) \ @@ -131,7 +131,7 @@ static inline long op_name(long val, long *ptr) \ op_string " %[new],%[val]\n" \ " csg %[old],%[new],%[ptr]\n" \ " jl 0b" \ - : [old] "=d" (old), [new] "=&d" (new), [ptr] "+Q" (*ptr)\ + : [old] "=d" (old), [new] "=&d" (new), [ptr] "+S" (*ptr)\ : [val] "d" (val), "0" (*ptr) : "cc", "memory"); \ return old; \ } |