Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/lib/libkern/arch/arm Thumbify



details:   https://anonhg.NetBSD.org/src/rev/001bc715e770
branches:  trunk
changeset: 789531:001bc715e770
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Aug 21 08:30:18 2013 +0000

description:
Thumbify

diffstat:

 sys/lib/libkern/arch/arm/clzsi2.S |  27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diffs (78 lines):

diff -r b2e773c10182 -r 001bc715e770 sys/lib/libkern/arch/arm/clzsi2.S
--- a/sys/lib/libkern/arch/arm/clzsi2.S Wed Aug 21 08:15:19 2013 +0000
+++ b/sys/lib/libkern/arch/arm/clzsi2.S Wed Aug 21 08:30:18 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clzsi2.S,v 1.5 2013/08/11 04:58:01 matt Exp $ */
+/* $NetBSD: clzsi2.S,v 1.6 2013/08/21 08:30:18 matt Exp $ */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,7 +30,6 @@
 #include <machine/asm.h>
 
        .text
-ENTRY(__clzdi2)
 #ifdef __ARMEB__
 #define        HI      r0
 #define        LO      r1
@@ -39,22 +38,26 @@
 #define        LO      r0
 #endif
 #if defined(_ARM_ARCH_5)
-#ifdef __thumb__
-       cmp     HI, #0
-       beq     1f
+#if defined(__thumb__) && defined(_ARM_ARCH_T2)
+ENTRY(__clzdi2)
+       cbz     HI, 1f
        clz     r0, HI          /* count leading zeros in high word */
        RET
 1:     clz     r0, LO          /* yes, count in low word */
-       add     r0, r0, #32     /*      and add the bits in the high word */
+       adds    r0, r0, #32     /*      and add the bits in the high word */
        RET
+END(__clzdi2)
 #else
+ARM_ENTRY(__clzdi2)
        teq     HI, #0          /* high word all zero? */
        clzne   r0, HI          /* count leading zeros in high word */
        clzeq   r0, LO          /* yes, count in low word */
        addeq   r0, r0, #32     /*      and add the bits in the high word */
        RET
+END(__clzdi2)
 #endif
 #else
+ARM_ENTRY(__clzdi2)
        movs    r3, HI
        movne   r0, #31
        bne     .L_clz
@@ -63,14 +66,20 @@
        bne     .L_clz
        mov     r0, #64
        RET
+END(__clzdi2)
 #endif
-END(__clzdi2)
 
+#if defined(_ARM_ARCH_5)
+#if defined(_ARM_ARCH_7)
 ENTRY(__clzsi2)
-#if defined(_ARM_ARCH_5)
+#else
+ARM_ENTRY(__clzsi2)
+#endif
        clz     r0, r0
        RET
+END(__clzsi2)
 #else
+ARM_ENTRY(__clzsi2)
        movs    r3, r0
        moveq   r0, #32
        RETc(eq)
@@ -115,5 +124,5 @@
 #endif
 #endif /* __OPTIMIZE_SIZE__ */
        RET
+END(__clzsi2)
 #endif  /* _ARM_ARCH_5 */
-END(__clzsi2)



Home | Main Index | Thread Index | Old Index