summaryrefslogtreecommitdiffstats
path: root/include/asm-mips/string.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-16 01:07:24 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-16 01:07:24 +0000
commit95db6b748fc86297827fbd9c9ef174d491c9ad89 (patch)
tree27a92a942821cde1edda9a1b088718d436b3efe4 /include/asm-mips/string.h
parent45b27b0a0652331d104c953a5b192d843fff88f8 (diff)
Merge with Linux 2.3.40.
Diffstat (limited to 'include/asm-mips/string.h')
-rw-r--r--include/asm-mips/string.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/include/asm-mips/string.h b/include/asm-mips/string.h
index 502822d0e..b152af535 100644
--- a/include/asm-mips/string.h
+++ b/include/asm-mips/string.h
@@ -1,4 +1,4 @@
-/* $Id: string.h,v 1.10 1999/04/11 18:37:56 harald Exp $
+/* $Id: string.h,v 1.11 1999/08/13 17:07:28 harald Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -91,30 +91,31 @@ extern __inline__ int strcmp(__const__ char *__cs, __const__ char *__ct)
}
#define __HAVE_ARCH_STRNCMP
-extern __inline__ int strncmp(__const__ char *__cs, __const__ char *__ct, size_t __count)
+extern __inline__ int
+strncmp(__const__ char *__cs, __const__ char *__ct, size_t __count)
{
- int __res;
+ int __res;
- __asm__ __volatile__(
+ __asm__ __volatile__(
".set\tnoreorder\n\t"
".set\tnoat\n"
- "1:\tlbu\t%3,(%1)\n\t"
+ "1:\tlbu\t%3,(%0)\n\t"
"beqz\t%2,2f\n\t"
- "lbu\t$1,(%0)\n\t"
- "addiu\t%1,1\n\t"
- "subu\t%3,$1,%3\n\t"
- "bnez\t%3,2f\n\t"
+ "lbu\t$1,(%1)\n\t"
+ "subu\t%2,1\n\t"
+ "bne\t$1,%3,3f\n\t"
"addiu\t%0,1\n\t"
- "bnez\t%1,1b\n"
- "addiu\t%2,-1\n"
- "2:\n\t"
+ "bnez\t%3,1b\n\t"
+ "addiu\t%1,1\n"
+ "2:\tmove\t%3,$1\n"
+ "3:\tsubu\t%3,$1\n\t"
".set\tat\n\t"
".set\treorder"
: "=r" (__cs), "=r" (__ct), "=r" (__count), "=r" (__res)
: "0" (__cs), "1" (__ct), "2" (__count)
: "$1");
- return __res;
+ return __res;
}
#define __HAVE_ARCH_MEMSET