> -----Original Message-----
> From: Wilco Dijkstra <[email protected]>
> Sent: 12 November 2025 16:55
> To: GCC Patches <[email protected]>
> Cc: Alex Coplan <[email protected]>; Alice Carlotti
> <[email protected]>; Andrew Pinski
> <[email protected]>; Kyrylo Tkachov
> <[email protected]>; Tamar Christina <[email protected]>
> Subject: [PATCH] AArch64: Use dmb ishld+ishst for release fence
> 
> 
> Use dmb ishld and dmb ishst for a release fence since this is less
> restrictive than dmb ish.
> 
> Passes regress, OK for commit?
> 
> gcc:
>       * config/aarch64/atomics.md (*dmb): Expand release fence into dmb
> ishld
>       and dmb ishst.

So this is not my area of expertise, but from what's in the Arm ARM this looks
at least semantically correct for a release fence.

I think the patch is OK based on the docs, but please give people a day or two 
to object.

Thanks,
Tamar

> 
> ---
> 
> diff --git a/gcc/config/aarch64/atomics.md
> b/gcc/config/aarch64/atomics.md
> index
> ea4a9367fc880ed449870f80aecd571bf1d61d7b..d4b4afb5815db50bc4344
> c885eb03e95cc153f61 100644
> --- a/gcc/config/aarch64/atomics.md
> +++ b/gcc/config/aarch64/atomics.md
> @@ -870,7 +870,13 @@ (define_insn "*dmb"
>      enum memmodel model = memmodel_from_int (INTVAL (operands[1]));
>      if (is_mm_acquire (model))
>        return "dmb\\tishld";
> +    else if (is_mm_release (model))
> +      return "dmb\\tishld\;dmb\\tishst";
>      else
>        return "dmb\\tish";
>    }
> +  [(set (attr "length")
> +    (if_then_else
> +     (match_test "is_mm_release (memmodel_from_int (INTVAL
> (operands[1])))")
> +      (const_int 8) (const_int 4)))]
>  )

Reply via email to