Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92b59929 authored by Helge Deller's avatar Helge Deller
Browse files

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: default avatarHelge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org> # 3.10
parent 594174d8
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -32,9 +32,12 @@ static inline void set_eiem(unsigned long val)
	cr;				\
})

#define mtsp(gr, cr) \
#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 */