Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a22fb7ff1259e6ee87d0ba3559c9f7b7d0cb20d2
Commit:     a22fb7ff1259e6ee87d0ba3559c9f7b7d0cb20d2
Parent:     03513bccad33667ed738cfd96dc5757e539e0bdb
Author:     Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 19 15:29:28 2008 +0100
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Tue Feb 19 15:29:33 2008 +0100

    [S390] find bit corner case.
    
    Fix [ext2_]find_first_[zero_]bit for the corner case of an all clear
    or all set bit field by always handling that last word of the bit field
    with __ffz_word/__ffs_word.
    
    Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 include/asm-s390/bitops.h |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h
index ab83c84..965394e 100644
--- a/include/asm-s390/bitops.h
+++ b/include/asm-s390/bitops.h
@@ -456,16 +456,18 @@ static inline unsigned long __ffz_word_loop(const 
unsigned long *addr,
 
        asm volatile(
 #ifndef __s390x__
-               "       ahi     %1,31\n"
-               "       srl     %1,5\n"
+               "       ahi     %1,-1\n"
+               "       sra     %1,5\n"
+               "       jz      1f\n"
                "0:     c       %2,0(%0,%3)\n"
                "       jne     1f\n"
                "       la      %0,4(%0)\n"
                "       brct    %1,0b\n"
                "1:\n"
 #else
-               "       aghi    %1,63\n"
-               "       srlg    %1,%1,6\n"
+               "       aghi    %1,-1\n"
+               "       srag    %1,%1,6\n"
+               "       jz      1f\n"
                "0:     cg      %2,0(%0,%3)\n"
                "       jne     1f\n"
                "       la      %0,8(%0)\n"
@@ -491,16 +493,18 @@ static inline unsigned long __ffs_word_loop(const 
unsigned long *addr,
 
        asm volatile(
 #ifndef __s390x__
-               "       ahi     %1,31\n"
-               "       srl     %1,5\n"
+               "       ahi     %1,-1\n"
+               "       sra     %1,5\n"
+               "       jz      1f\n"
                "0:     c       %2,0(%0,%3)\n"
                "       jne     1f\n"
                "       la      %0,4(%0)\n"
                "       brct    %1,0b\n"
                "1:\n"
 #else
-               "       aghi    %1,63\n"
-               "       srlg    %1,%1,6\n"
+               "       aghi    %1,-1\n"
+               "       srag    %1,%1,6\n"
+               "       jz      1f\n"
                "0:     cg      %2,0(%0,%3)\n"
                "       jne     1f\n"
                "       la      %0,8(%0)\n"
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to