]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AArch64: Use dmb ishld+ishst for release fence
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Wed, 17 Sep 2025 16:36:33 +0000 (16:36 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Thu, 27 Nov 2025 16:52:07 +0000 (16:52 +0000)
Use dmb ishld and dmb ishst for a release fence since this is less
restrictive than dmb ish.

gcc:
* config/aarch64/atomics.md (*dmb): Expand release fence into dmb ishld
and dmb ishst.

gcc/config/aarch64/atomics.md

index ea4a9367fc880ed449870f80aecd571bf1d61d7b..d4b4afb5815db50bc4344c885eb03e95cc153f61 100644 (file)
     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)))]
 )