All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Michael Schmitz <schmitzmic@gmail.com>, linux-m68k@lists.linux-m68k.org
Subject: Re: clear_bit_unlock_is_negative_byte
Date: Sat, 22 Jul 2023 17:26:07 +0200	[thread overview]
Message-ID: <87tttwezn4.fsf@igel.home> (raw)
In-Reply-To: <ZLvrd+tk6HiqB2Qk@casper.infradead.org> (Matthew Wilcox's message of "Sat, 22 Jul 2023 15:45:11 +0100")

On Jul 22 2023, Matthew Wilcox wrote:

> 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?

They use a memory clobber, because the "o" constraint cannot accurately
describe the situation there.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

  reply	other threads:[~2023-07-22 15:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20 19:27 clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-20 22:37 ` clear_bit_unlock_is_negative_byte Michael Schmitz
2023-07-21  1:12   ` clear_bit_unlock_is_negative_byte Michael Schmitz
2023-07-21  1:32     ` clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-21  1:43       ` clear_bit_unlock_is_negative_byte Michael Schmitz
2023-07-21 17:03         ` clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-21 22:07           ` clear_bit_unlock_is_negative_byte Michael Schmitz
2023-07-22  6:24         ` clear_bit_unlock_is_negative_byte Andreas Schwab
2023-07-22 14:45           ` clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-22 15:26             ` Andreas Schwab [this message]
2023-07-22 15:38               ` clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-21  6:34 ` clear_bit_unlock_is_negative_byte Andreas Schwab
2023-07-21  8:57   ` clear_bit_unlock_is_negative_byte Brad Boyer
2023-07-21  9:18     ` clear_bit_unlock_is_negative_byte Andreas Schwab
2023-07-21 11:59   ` clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-21 12:52     ` clear_bit_unlock_is_negative_byte Andreas Schwab
2023-07-21 20:29     ` clear_bit_unlock_is_negative_byte Brad Boyer
2023-07-22  3:42       ` clear_bit_unlock_is_negative_byte Matthew Wilcox
2023-07-22 23:49         ` clear_bit_unlock_is_negative_byte Brad Boyer
2023-07-23  1:08           ` clear_bit_unlock_is_negative_byte Michael Schmitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tttwezn4.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=schmitzmic@gmail.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.