From: Andreas Schwab <schwab@suse.de>
To: Jessica Clarke <jrtc27@jrtc27.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv/atomic: Do proper sign extension also for unsigned in arch_cmpxchg
Date: Mon, 03 Feb 2025 09:42:55 +0100 [thread overview]
Message-ID: <mvmo6zj2zcg.fsf@suse.de> (raw)
In-Reply-To: <CC2D9220-F8DE-4CC8-ACAD-7B1A21E276FE@jrtc27.com> (Jessica Clarke's message of "Thu, 30 Jan 2025 17:21:28 +0000")
On Jan 30 2025, Jessica Clarke wrote:
> On 30 Jan 2025, at 15:53, Andreas Schwab <schwab@suse.de> wrote:
>>
>> On Jan 30 2025, Alexandre Ghiti wrote:
>>
>>> a2 is used as it is passed by the calling function, so we can't be sure a2
>>> is sign extended to me, what am I missing?
>>
>> 32-bit scalar arguments are guaranteed to be sign extended on entry.
>
> Firstly, the calling convention is irrelevant if the function is
> inlined, which this almost always will be.
This is only about the non-inlined variant.
--
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-03 8:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-30 9:25 [PATCH] riscv/atomic: Do proper sign extension also for unsigned in arch_cmpxchg Andreas Schwab
2025-01-30 14:18 ` Alexandre Ghiti
2025-01-30 14:52 ` Andreas Schwab
2025-01-30 15:23 ` Alexandre Ghiti
2025-01-30 15:53 ` Andreas Schwab
2025-01-30 17:21 ` Jessica Clarke
2025-02-03 8:42 ` Andreas Schwab [this message]
2025-02-03 13:57 ` Maciej W. Rozycki
2025-02-03 21:22 ` Jessica Clarke
2025-02-04 16:44 ` Maciej W. Rozycki
2025-01-30 14:40 ` Andrew Jones
2025-01-30 21:35 ` David Laight
2025-02-03 8:42 ` Andreas Schwab
2025-02-01 12:17 ` Xi Ruoyao
2025-02-04 8:33 ` Alexandre Ghiti
2025-02-13 18:30 ` patchwork-bot+linux-riscv
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=mvmo6zj2zcg.fsf@suse.de \
--to=schwab@suse.de \
--cc=alex@ghiti.fr \
--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