Commit a22fb7ff authored by Martin Schwidefsky's avatar Martin Schwidefsky

[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: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 03513bcc
...@@ -456,16 +456,18 @@ static inline unsigned long __ffz_word_loop(const unsigned long *addr, ...@@ -456,16 +456,18 @@ static inline unsigned long __ffz_word_loop(const unsigned long *addr,
asm volatile( asm volatile(
#ifndef __s390x__ #ifndef __s390x__
" ahi %1,31\n" " ahi %1,-1\n"
" srl %1,5\n" " sra %1,5\n"
" jz 1f\n"
"0: c %2,0(%0,%3)\n" "0: c %2,0(%0,%3)\n"
" jne 1f\n" " jne 1f\n"
" la %0,4(%0)\n" " la %0,4(%0)\n"
" brct %1,0b\n" " brct %1,0b\n"
"1:\n" "1:\n"
#else #else
" aghi %1,63\n" " aghi %1,-1\n"
" srlg %1,%1,6\n" " srag %1,%1,6\n"
" jz 1f\n"
"0: cg %2,0(%0,%3)\n" "0: cg %2,0(%0,%3)\n"
" jne 1f\n" " jne 1f\n"
" la %0,8(%0)\n" " la %0,8(%0)\n"
...@@ -491,16 +493,18 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr, ...@@ -491,16 +493,18 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr,
asm volatile( asm volatile(
#ifndef __s390x__ #ifndef __s390x__
" ahi %1,31\n" " ahi %1,-1\n"
" srl %1,5\n" " sra %1,5\n"
" jz 1f\n"
"0: c %2,0(%0,%3)\n" "0: c %2,0(%0,%3)\n"
" jne 1f\n" " jne 1f\n"
" la %0,4(%0)\n" " la %0,4(%0)\n"
" brct %1,0b\n" " brct %1,0b\n"
"1:\n" "1:\n"
#else #else
" aghi %1,63\n" " aghi %1,-1\n"
" srlg %1,%1,6\n" " srag %1,%1,6\n"
" jz 1f\n"
"0: cg %2,0(%0,%3)\n" "0: cg %2,0(%0,%3)\n"
" jne 1f\n" " jne 1f\n"
" la %0,8(%0)\n" " la %0,8(%0)\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment