Commit b1bac3734581ab6788bbfe125c62914f8d6d5e01

Authored by Steven J. Hill
Committed by Ralf Baechle
1 parent 0131f2b2c9

MIPS: microMIPS: Optimise 'strlen' core library function.

Optimise 'strlen' to use microMIPS instructions and/or optimisations
for binary size reduction. When the microMIPS ISA is not being used,
the library function compiles to the original binary code.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>

Showing 1 changed file with 5 additions and 4 deletions Side-by-side Diff

arch/mips/lib/strlen_user.S
... ... @@ -3,8 +3,9 @@
3 3 * License. See the file "COPYING" in the main directory of this archive
4 4 * for more details.
5 5 *
6   - * Copyright (c) 1996, 1998, 1999, 2004 by Ralf Baechle
7   - * Copyright (c) 1999 Silicon Graphics, Inc.
  6 + * Copyright (C) 1996, 1998, 1999, 2004 by Ralf Baechle
  7 + * Copyright (C) 1999 Silicon Graphics, Inc.
  8 + * Copyright (C) 2011 MIPS Technologies, Inc.
8 9 */
9 10 #include <asm/asm.h>
10 11 #include <asm/asm-offsets.h>
11 12  
... ... @@ -28,9 +29,9 @@
28 29  
29 30 FEXPORT(__strlen_user_nocheck_asm)
30 31 move v0, a0
31   -1: EX(lb, t0, (v0), .Lfault)
  32 +1: EX(lbu, v1, (v0), .Lfault)
32 33 PTR_ADDIU v0, 1
33   - bnez t0, 1b
  34 + bnez v1, 1b
34 35 PTR_SUBU v0, a0
35 36 jr ra
36 37 END(__strlen_user_asm)