public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Patrick O'Neill <patrick@rivosinc.com>
To: gcc-patches@gcc.gnu.org, Jeff Law <jeffreyalaw@gmail.com>
Cc: palmer@rivosinc.com, richard.guenther@gmail.com,
	kito.cheng@gmail.com, david.abd@gmail.com, schwab@linux-m68k.org,
	schwab@suse.de, gnu-toolchain@rivosinc.com
Subject: Re: [gcc13 backport] RISCV: Inline subword atomic ops
Date: Tue, 9 May 2023 09:01:45 -0700	[thread overview]
Message-ID: <a2623212-4c76-81e5-e2ce-35c6b5ffca7e@rivosinc.com> (raw)
In-Reply-To: <20230503171922.1120098-1-patrick@rivosinc.com>

Ping.

On 5/3/23 10:19, Patrick O'Neill wrote:

> RISC-V has no support for subword atomic operations; code currently
> generates libatomic library calls.
>
> This patch changes the default behavior to inline subword atomic calls
> (using the same logic as the existing library call).
> Behavior can be specified using the -minline-atomics and
> -mno-inline-atomics command line flags.
>
> gcc/libgcc/config/riscv/atomic.c has the same logic implemented in asm.
> This will need to stay for backwards compatibility and the
> -mno-inline-atomics flag.
>
> 2023-05-03 Patrick O'Neill <patrick@rivosinc.com>
>
> gcc/ChangeLog:
> 	PR target/104338
> 	* config/riscv/riscv-protos.h: Add helper function stubs.
> 	* config/riscv/riscv.cc: Add helper functions for subword masking.
> 	* config/riscv/riscv.opt: Add command-line flags
> 	-minline-atomics and -mno-inline-atomics.
> 	* config/riscv/sync.md: Add masking logic and inline asm for
> 	fetch_and_op, fetch_and_nand, CAS, and exchange ops.
> 	* doc/invoke.texi: Add blurb regarding new command-line flags
> 	-minline-atomics and -mno-inline-atomics.
>
> libgcc/ChangeLog:
> 	PR target/104338
> 	* config/riscv/atomic.c: Add reference to duplicate logic.
>
> gcc/testsuite/ChangeLog:
> 	PR target/104338
> 	* gcc.target/riscv/inline-atomics-1.c: New test.
> 	* gcc.target/riscv/inline-atomics-2.c: New test.
> 	* gcc.target/riscv/inline-atomics-3.c: New test.
> 	* gcc.target/riscv/inline-atomics-4.c: New test.
> 	* gcc.target/riscv/inline-atomics-5.c: New test.
> 	* gcc.target/riscv/inline-atomics-6.c: New test.
> 	* gcc.target/riscv/inline-atomics-7.c: New test.
> 	* gcc.target/riscv/inline-atomics-8.c: New test.
>
> Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
> ---
> This backport includes all the subsequent fixes.
> Squashed GCC-14 commits:
>    https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=f797260adaf52bee0ec0e16190bbefbe1bfc3692
>    https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=2a26872984c109a98d0ad733b0c68c3e1648ec86
>
> Fixed ChangeLog:
>    https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=9cfdd5af3efd4a7e52ae7f97f55effc436c0cf45
> ---
> The GCC-14 build error[1] was caused by the subsequent A.6 mappings
> change[2], not the inline atomics change (this backport).
> [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=4bd434fbfc7865961a8e10d7e9601b28765ce7be
> [2] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=bff7c77386447936dd614ebc7086b826c99c6642
> ---
> There is a related follow-on GCC-14 patch to config/riscv/linux:
>    https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=203f3060dd363361b172f7295f42bb6bf5ac0b3b
>
> The changes from that patch are not included in this backport.
> ---

  reply	other threads:[~2023-05-09 16:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03 17:19 Patrick O'Neill
2023-05-09 16:01 ` Patrick O'Neill [this message]
2023-05-16  4:32   ` Jeff Law
2023-05-16 17:01     ` [committed gcc13 " Patrick O'Neill

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=a2623212-4c76-81e5-e2ce-35c6b5ffca7e@rivosinc.com \
    --to=patrick@rivosinc.com \
    --cc=david.abd@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gnu-toolchain@rivosinc.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=kito.cheng@gmail.com \
    --cc=palmer@rivosinc.com \
    --cc=richard.guenther@gmail.com \
    --cc=schwab@linux-m68k.org \
    --cc=schwab@suse.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).