Re: clear_bit_unlock_is_negative_byte

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

 



On Sat, Jul 22, 2023 at 08:24:34AM +0200, Andreas Schwab wrote:
On Jul 21 2023, Michael Schmitz wrote:

static inline bool clear_bit_unlock_is_negative_byte(unsigned int nr,
                volatile unsigned long *p)
{
        unsigned char *cp = (unsigned char *) p;
        char result;
        char mask = 1 << nr;    /* nr guaranteed to be < 7 */

        __asm__ __volatile__ ("eori.b %1, %2; smi %0"
                : "=d" (result)
                : "i" (mask), "o" (*(cp+3))

That should use "id" as constraint, so that the compiler can share the
constant with other insns.  Also, the third operand is modified, so it
needs to be marked as in/out.

The "o" constraint is shared with bfset_mem_set_bit,
bfclr_mem_test_and_clear_bit and a few other functions.  Should they
all be changed?  Some use "+m".



[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux