Re: [PATCH v5] RISCV: Inline subword atomic ops

2023-04-18 Thread Jeff Law via Gcc-patches
On 4/18/23 14:48, Patrick O'Neill wrote: On 4/18/23 09:59, Jeff Law wrote: On 4/18/23 08:28, Patrick O'Neill wrote: ... +  rtx addr = force_reg (Pmode, XEXP (mem, 0)); + +  rtx aligned_addr = gen_reg_rtx (Pmode); +  emit_move_insn (aligned_addr,  gen_rtx_AND (Pmode, addr, +  

Re: [PATCH v5] RISCV: Inline subword atomic ops

2023-04-18 Thread Patrick O'Neill
On 4/18/23 09:59, Jeff Law wrote: On 4/18/23 08:28, Patrick O'Neill wrote: ... +  rtx addr = force_reg (Pmode, XEXP (mem, 0)); + +  rtx aligned_addr = gen_reg_rtx (Pmode); +  emit_move_insn (aligned_addr,  gen_rtx_AND (Pmode, addr, +  gen_int_mode (-4, Pmode))); So rather

Re: [PATCH v5] RISCV: Inline subword atomic ops

2023-04-18 Thread Jeff Law via Gcc-patches
On 4/18/23 08:28, 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

Re: [PATCH v5] RISCV: Inline subword atomic ops

2023-04-18 Thread Andreas Schwab
On Apr 18 2023, Patrick O'Neill wrote: > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > index a38547f53e5..9c3e91d2fee 100644 > --- a/gcc/doc/invoke.texi > +++ b/gcc/doc/invoke.texi > @@ -1227,6 +1227,7 @@ See RS/6000 and PowerPC Options. > -mstack-protector-guard=@var{guard} -mstack-p

[PATCH v5] RISCV: Inline subword atomic ops

2023-04-18 Thread Patrick O'Neill
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-a