Skip to content

Commit

Permalink
MIPS: __delay ABI-dependent subtraction simplification
Browse files Browse the repository at this point in the history
This small update to the previous fix to __delay removes a conditional
around the ABI-dependent subtraction operation within an inline asm in
favor to the standard <asm/asm.h> LONG_SUBU macro.  No change in code
produced.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/6703/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Maciej W. Rozycki authored and Ralf Baechle committed May 30, 2014
1 parent 06947aa commit e496453
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions arch/mips/lib/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
#include <linux/module.h>
#include <linux/param.h>
#include <linux/smp.h>
#include <linux/stringify.h>

#include <asm/asm.h>
#include <asm/compiler.h>
#include <asm/war.h>

Expand All @@ -27,11 +29,7 @@ void __delay(unsigned long loops)
" .set noreorder \n"
" .align 3 \n"
"1: bnez %0, 1b \n"
#if BITS_PER_LONG == 32
" subu %0, %1 \n"
#else
" dsubu %0, %1 \n"
#endif
" " __stringify(LONG_SUBU) " %0, %1 \n"
" .set reorder \n"
: "=r" (loops)
: GCC_DADDI_IMM_ASM() (1), "0" (loops));
Expand Down

0 comments on commit e496453

Please sign in to comment.