aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/include
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2013-06-29 16:08:03 -0400
committerHelge Deller <deller@gmx.de>2013-07-09 16:09:21 -0400
commit92b59929825d67db575043a76651865d16873b36 (patch)
treea6d057fc7311d88d6fad158b676bb28c35945a4a /arch/parisc/include
parent594174d810a29982929cbb454dafee4a1498e4fb (diff)
parisc: optimize mtsp(0,sr) inline assembly
If the value which should be moved into a space register is zero, we can optimize the inline assembly to become "mtsp %r0,%srX". Signed-off-by: Helge Deller <deller@gmx.de> Cc: <stable@vger.kernel.org> # 3.10
Diffstat (limited to 'arch/parisc/include')
-rw-r--r--arch/parisc/include/asm/special_insns.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/parisc/include/asm/special_insns.h b/arch/parisc/include/asm/special_insns.h
index d306b75bc77f..e1509308899f 100644
--- a/arch/parisc/include/asm/special_insns.h
+++ b/arch/parisc/include/asm/special_insns.h
@@ -32,9 +32,12 @@ static inline void set_eiem(unsigned long val)
32 cr; \ 32 cr; \
33}) 33})
34 34
35#define mtsp(gr, cr) \ 35#define mtsp(val, cr) \
36 __asm__ __volatile__("mtsp %0,%1" \ 36 { if (__builtin_constant_p(val) && ((val) == 0)) \
37 __asm__ __volatile__("mtsp %%r0,%0" : : "i" (cr) : "memory"); \
38 else \
39 __asm__ __volatile__("mtsp %0,%1" \
37 : /* no outputs */ \ 40 : /* no outputs */ \
38 : "r" (gr), "i" (cr) : "memory") 41 : "r" (val), "i" (cr) : "memory"); }
39 42
40#endif /* __PARISC_SPECIAL_INSNS_H */ 43#endif /* __PARISC_SPECIAL_INSNS_H */