]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm.md: (define_attr "conds"): Update comment.
authorMarcus Shawcroft <marcus.shawcroft@arm.com>
Mon, 13 Sep 2010 15:06:26 +0000 (15:06 +0000)
committerMarcus Shawcroft <mshawcroft@gcc.gnu.org>
Mon, 13 Sep 2010 15:06:26 +0000 (15:06 +0000)
2010-09-13  Marcus Shawcroft  <marcus.shawcroft@arm.com>

        * config/arm/arm.md: (define_attr "conds"): Update comment.
* config/arm/sync.md (arm_sync_compare_and_swapsi): Change
          conds attribute to clob.
          (arm_sync_compare_and_swapsi): Likewise.
  (arm_sync_compare_and_swap<mode>): Likewise.
  (arm_sync_lock_test_and_setsi): Likewise.
  (arm_sync_lock_test_and_set<mode>): Likewise.
  (arm_sync_new_<sync_optab>si): Likewise.
  (arm_sync_new_nandsi): Likewise.
  (arm_sync_new_<sync_optab><mode>): Likewise.
  (arm_sync_new_nand<mode>): Likewise.
  (arm_sync_old_<sync_optab>si): Likewise.
  (arm_sync_old_nandsi): Likewise.
  (arm_sync_old_<sync_optab><mode>): Likewise.
  (arm_sync_old_nand<mode>): Likewise.

2010-09-13  Marcus Shawcroft  <marcus.shawcroft@arm.com>

* gcc.target/arm/sync-1.c: New.

From-SVN: r164247

gcc/ChangeLog
gcc/config/arm/arm.md
gcc/config/arm/sync.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/sync-1.c [new file with mode: 0644]

index 962928714c8506ab0662904805ce045d8fa194bb..8d47a83402ec8b70fabf528ba579b34dc2505e48 100644 (file)
@@ -1,3 +1,21 @@
+2010-09-13  Marcus Shawcroft  <marcus.shawcroft@arm.com>
+
+       * config/arm/arm.md: (define_attr "conds"): Update comment.
+       * config/arm/sync.md (arm_sync_compare_and_swapsi): Change 
+       conds attribute to clob.
+        (arm_sync_compare_and_swapsi): Likewise.
+       (arm_sync_compare_and_swap<mode>): Likewise.
+       (arm_sync_lock_test_and_setsi): Likewise.
+       (arm_sync_lock_test_and_set<mode>): Likewise.
+       (arm_sync_new_<sync_optab>si): Likewise.
+       (arm_sync_new_nandsi): Likewise.
+       (arm_sync_new_<sync_optab><mode>): Likewise.
+       (arm_sync_new_nand<mode>): Likewise.
+       (arm_sync_old_<sync_optab>si): Likewise.
+       (arm_sync_old_nandsi): Likewise.
+       (arm_sync_old_<sync_optab><mode>): Likewise.
+       (arm_sync_old_nand<mode>): Likewise.
+
 2010-09-13  Olivier Hainque  <hainque@adacore.com>
 
         * fwprop.c (forward_propagate_and_simplify): Only attach a
index 5f52fe99739072d46c17b3ed798404516875eb36..d10d04ba74d948d3dd3b046083c617c6e8bbc4d3 100644 (file)
 ; CLOB means that the condition codes are altered in an undefined manner, if
 ;   they are altered at all
 ;
-; UNCONDITIONAL means the instions can not be conditionally executed.
+; UNCONDITIONAL means the instruction can not be conditionally executed and
+;   that the instruction does not use or alter the condition codes.
 ;
-; NOCOND means that the condition codes are neither altered nor affect the
-;   output of this insn
+; NOCOND means that the instruction does not use or alter the condition
+;   codes but can be converted into a conditionally exectuted instruction.
 
 (define_attr "conds" "use,set,clob,unconditional,nocond"
        (if_then_else
index f942d1f94e74684b8801c8ac501e7b016b667d55..4c4b4fa106bdf86cc06f5eb2b34d58a54ca2ae6f 100644 (file)
    (set_attr "sync_new_value"       "3")
    (set_attr "sync_t1"              "0")
    (set_attr "sync_t2"              "4")
-   (set_attr "conds" "nocond")
+   (set_attr "conds" "clob")
    (set_attr "predicable" "no")])
 
 (define_insn "arm_sync_compare_and_swap<mode>"
    (set_attr "sync_new_value"       "3")
    (set_attr "sync_t1"              "0")
    (set_attr "sync_t2"              "4")
-   (set_attr "conds" "nocond")
+   (set_attr "conds" "clob")
    (set_attr "predicable" "no")])
 
 (define_insn "arm_sync_lock_test_and_setsi"
    (set_attr "sync_new_value"       "2")
    (set_attr "sync_t1"              "0")
    (set_attr "sync_t2"              "3")
-   (set_attr "conds" "nocond")
+   (set_attr "conds" "clob")
    (set_attr "predicable" "no")])
 
 (define_insn "arm_sync_lock_test_and_set<mode>"
    (set_attr "sync_new_value"       "2")
    (set_attr "sync_t1"              "0")
    (set_attr "sync_t2"              "3")
-   (set_attr "conds" "nocond")
+   (set_attr "conds" "clob")
    (set_attr "predicable" "no")])
 
 (define_insn "arm_sync_new_<sync_optab>si"
    (set_attr "sync_t1"              "0")
    (set_attr "sync_t2"              "3")
    (set_attr "sync_op"              "<sync_optab>")
-   (set_attr "conds" "nocond")
+   (set_attr "conds" "clob")
    (set_attr "predicable" "no")])
 
 (define_insn "arm_sync_new_nandsi"
    (set_attr "sync_t1"              "0")
    (set_attr "sync_t2"              "3")
    (set_attr "sync_op"              "nand")
-   (set_attr "conds" "nocond")
+   (set_attr "conds" "clob")
    (set_attr "predicable" "no")])
 
 (define_insn "arm_sync_new_<sync_optab><mode>"
    (set_attr "sync_t1"              "0")
    (set_attr "sync_t2"              "3")
    (set_attr "sync_op"              "<sync_optab>")
-   (set_attr "conds" "nocond")
+   (set_attr "conds" "clob")
    (set_attr "predicable" "no")])
 
 (define_insn "arm_sync_new_nand<mode>"
    (set_attr "sync_t1"              "0")
    (set_attr "sync_t2"              "3")
    (set_attr "sync_op"              "nand")
-   (set_attr "conds" "nocond")
+   (set_attr "conds" "clob")
    (set_attr "predicable" "no")])
 
 (define_insn "arm_sync_old_<sync_optab>si"
    (set_attr "sync_t1"              "3")
    (set_attr "sync_t2"              "4")
    (set_attr "sync_op"              "<sync_optab>")
-   (set_attr "conds" "nocond")
+   (set_attr "conds" "clob")
    (set_attr "predicable" "no")])
 
 (define_insn "arm_sync_old_nandsi"
    (set_attr "sync_t1"              "3")
    (set_attr "sync_t2"              "4")
    (set_attr "sync_op"              "nand")
-   (set_attr "conds" "nocond")
+   (set_attr "conds"               "clob")
    (set_attr "predicable" "no")])
 
 (define_insn "arm_sync_old_<sync_optab><mode>"
    (set_attr "sync_t1"              "3")
    (set_attr "sync_t2"              "4")
    (set_attr "sync_op"              "<sync_optab>")
-   (set_attr "conds" "nocond")
+   (set_attr "conds"               "clob")
    (set_attr "predicable" "no")])
 
 (define_insn "arm_sync_old_nand<mode>"
    (set_attr "sync_t1"              "3")
    (set_attr "sync_t2"              "4")
    (set_attr "sync_op"              "nand")
-   (set_attr "conds" "nocond")
+   (set_attr "conds"                "clob")
    (set_attr "predicable" "no")])
 
 (define_insn "*memory_barrier"
index f01d8ba6b013133944afe65787d0c2222a275107..efcecb6c53e2909eb46841bb6c373683c58ffd2c 100644 (file)
@@ -1,3 +1,7 @@
+2010-09-13  Marcus Shawcroft  <marcus.shawcroft@arm.com>
+
+       * gcc.target/arm/sync-1.c: New.
+
 2010-09-12  Olivier Hainque  <hainque@adacore.com>
 
        * gnat.dg/memtrap.adb: New test.
diff --git a/gcc/testsuite/gcc.target/arm/sync-1.c b/gcc/testsuite/gcc.target/arm/sync-1.c
new file mode 100644 (file)
index 0000000..ad85a04
--- /dev/null
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -march=armv7-a" } */
+
+volatile int mem;
+
+int
+bar (int x, int y)
+{
+  if (x)
+    __sync_fetch_and_add(&mem, y);
+  return 0;
+}
+
+extern void abort (void);
+
+int
+main (int argc, char *argv[])
+{
+  mem = 0;
+  bar (0, 1);
+  bar (1, 1);
+  if (mem != 1)
+    abort ();
+  return 0;
+}