Skip to content

Commit

Permalink
MIPS: Use compact branch for LL/SC loops on MIPSr6+
Browse files Browse the repository at this point in the history
When targeting MIPSr6 or higher make use of a compact branch in LL/SC
loops, preventing the insertion of a delay slot nop that only serves to
waste space.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-kernel@vger.kernel.org
  • Loading branch information
Paul Burton committed Oct 7, 2019
1 parent 878f75c commit ef85d05
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/mips/include/asm/llsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef __ASM_LLSC_H
#define __ASM_LLSC_H

#include <asm/isa-rev.h>

#if _MIPS_SZLONG == 32
#define SZLONG_LOG 5
#define SZLONG_MASK 31UL
Expand All @@ -32,6 +34,8 @@
*/
#if R10000_LLSC_WAR
# define __SC_BEQZ "beqzl "
#elif MIPS_ISA_REV >= 6
# define __SC_BEQZ "beqzc "
#else
# define __SC_BEQZ "beqz "
#endif
Expand Down

0 comments on commit ef85d05

Please sign in to comment.