[PATCH] Add __sync_fetch_and_nand (again)

hfinkel at anl.gov hfinkel at anl.gov
Thu Oct 2 13:58:49 PDT 2014


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6881
@@ +6880,3 @@
+  "the newer semantics are provided here">,
+  InGroup<DiagGroup<"gcc-intrinsic-semantics-changed">>;
+
----------------
rsmith wrote:
> I think you should pick a warning flag name that is specific to this particular change. We'd never want to put two different semantic changes in the same warning group, because we would want users to be able to turn off one of them without turning off the other.
Makes sense. I'll make it sync-fetch-and-nand-semantics-changed.

================
Comment at: test/CodeGen/Atomics.c:168-183
@@ -149,1 +167,18 @@
 
+  sc = __sync_nand_and_fetch (&sc, uc); // CHECK: atomicrmw nand
+                                        // CHECK: xor
+  uc = __sync_nand_and_fetch (&uc, uc); // CHECK: atomicrmw nand
+                                        // CHECK: xor
+  ss = __sync_nand_and_fetch (&ss, uc); // CHECK: atomicrmw nand
+                                        // CHECK: xor
+  us = __sync_nand_and_fetch (&us, uc); // CHECK: atomicrmw nand
+                                        // CHECK: xor
+  si = __sync_nand_and_fetch (&si, uc); // CHECK: atomicrmw nand
+                                        // CHECK: xor
+  ui = __sync_nand_and_fetch (&ui, uc); // CHECK: atomicrmw nand
+                                        // CHECK: xor
+  sll = __sync_nand_and_fetch (&sll, uc); // CHECK: atomicrmw nand
+                                          // CHECK: xor
+  ull = __sync_nand_and_fetch (&ull, uc); // CHECK: atomicrmw nand
+                                          // CHECK: xor
+
----------------
rsmith wrote:
> Please also check for the `and` instruction here.
Done.

http://reviews.llvm.org/D5429






More information about the cfe-commits mailing list