summaryrefslogtreecommitdiff
path: root/arch/parisc
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2013-06-29 22:08:03 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-21 18:21:26 -0700
commita2ebe4443fd55755cae5834e3f3021d3572cc463 (patch)
tree1eef36eb34dbe5211c8d14aab963c0a1589668d2 /arch/parisc
parent286f3bf473da48489bb539c08088fbb8dc64a35c (diff)
downloadlinux-3.10-a2ebe4443fd55755cae5834e3f3021d3572cc463.tar.gz
linux-3.10-a2ebe4443fd55755cae5834e3f3021d3572cc463.tar.bz2
linux-3.10-a2ebe4443fd55755cae5834e3f3021d3572cc463.zip
parisc: optimize mtsp(0,sr) inline assembly
commit 92b59929825d67db575043a76651865d16873b36 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/parisc')
-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 d306b75bc77..e1509308899 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)
cr; \
})
-#define mtsp(gr, cr) \
- __asm__ __volatile__("mtsp %0,%1" \
+#define mtsp(val, cr) \
+ { if (__builtin_constant_p(val) && ((val) == 0)) \
+ __asm__ __volatile__("mtsp %%r0,%0" : : "i" (cr) : "memory"); \
+ else \
+ __asm__ __volatile__("mtsp %0,%1" \
: /* no outputs */ \
- : "r" (gr), "i" (cr) : "memory")
+ : "r" (val), "i" (cr) : "memory"); }
#endif /* __PARISC_SPECIAL_INSNS_H */