From: Andreas Schwab <schwab@suse.de>
To: Jessica Clarke <jrtc27@jrtc27.com>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv/futex: sign extend compare value in atomic cmpxchg
Date: Tue, 04 Feb 2025 09:28:19 +0100 [thread overview]
Message-ID: <mvm7c662jx8.fsf@suse.de> (raw)
In-Reply-To: <A31D967F-B057-4C6D-B403-B4FB3973F185@jrtc27.com> (Jessica Clarke's message of "Mon, 3 Feb 2025 21:25:00 +0000")
On Feb 03 2025, Jessica Clarke wrote:
> On 3 Feb 2025, at 10:06, Andreas Schwab <schwab@suse.de> wrote:
>>
>> Make sure the compare value in the lr/sc loop is sign extended to match
>> what lr.w does. Fortunately, due to the compiler keeping the register
>> contents sign extended anyway the lack of the explicit extension didn't
>> result in wrong code so far, but this cannot be relied upon.
>
> GCC may guarantee this today,
It doesn't, that's the point!
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
next prev parent reply other threads:[~2025-02-04 8:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 10:06 [PATCH] riscv/futex: sign extend compare value in atomic cmpxchg Andreas Schwab
2025-02-03 15:33 ` Björn Töpel
2025-02-03 15:44 ` Andreas Schwab
2025-02-03 21:25 ` Jessica Clarke
2025-02-04 8:28 ` Andreas Schwab [this message]
2025-02-04 8:44 ` Alexandre Ghiti
2025-02-13 18:30 ` patchwork-bot+linux-riscv
2025-02-14 4:11 ` [External] " yunhui cui
2025-02-14 6:04 ` [External] " Jessica Clarke
2025-02-14 6:22 ` yunhui cui
2025-02-14 7:17 ` Jessica Clarke
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=mvm7c662jx8.fsf@suse.de \
--to=schwab@suse.de \
--cc=jrtc27@jrtc27.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox