From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4169 invoked by alias); 22 May 2015 08:30:23 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 4153 invoked by uid 89); 22 May 2015 08:30:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 May 2015 08:30:21 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by uk-mta-25.uk.mimecast.lan; Fri, 22 May 2015 09:30:18 +0100 Received: from e106327-lin.cambridge.arm.com ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 22 May 2015 09:30:19 +0100 Message-ID: <555EE91A.9090805@arm.com> Date: Fri, 22 May 2015 08:51:00 -0000 From: Matthew Wahab User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 3/3][Aarch64][PR target/65697] Add tests for __sync_builtins. References: <555E004C.3060704@arm.com> <555E0102.2010408@arm.com> In-Reply-To: <555E0102.2010408@arm.com> X-MC-Unique: MPw2mAx9T3iZgZr7xoOwIA-1 Content-Type: multipart/mixed; boundary="------------080104050107000905050501" X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg02068.txt.bz2 This is a multi-part message in MIME format. --------------080104050107000905050501 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 649 [Added PR number and updated patches] This patch adds tests for the code generated by the Aarch64 backend for the __sync builtins. Tested aarch64-none-linux-gnu with check-gcc. Ok for trunk? Matthew gcc/testsuite/ 2015-05-21 Matthew Wahab PR target/65697 * gcc.target/aarch64/sync-comp-swap.c: New. * gcc.target/aarch64/sync-comp-swap.x: New. * gcc.target/aarch64/sync-op-acquire.c: New. * gcc.target/aarch64/sync-op-acquire.x: New. * gcc.target/aarch64/sync-op-full.c: New. * gcc.target/aarch64/sync-op-full.x: New. * gcc.target/aarch64/sync-op-release.c: New. * gcc.target/aarch64/sync-op-release.x: New. --------------080104050107000905050501 Content-Type: text/x-patch; name=0003-Aarch64-Add-tests-for-__sync_builtins.patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0003-Aarch64-Add-tests-for-__sync_builtins.patch" Content-length: 5894 =46rom a3e8df9afce1098c1c616d66a309ce5bc5b95593 Mon Sep 17 00:00:00 2001 From: Matthew Wahab Date: Fri, 15 May 2015 09:31:42 +0100 Subject: [PATCH 3/3] [Aarch64] Add tests for __sync_builtins. Change-Id: I9f7cde85613dfe2cb6df55cbc732e683092f14d8 --- gcc/testsuite/gcc.target/aarch64/sync-comp-swap.c | 8 +++ gcc/testsuite/gcc.target/aarch64/sync-comp-swap.x | 13 ++++ gcc/testsuite/gcc.target/aarch64/sync-op-acquire.c | 8 +++ gcc/testsuite/gcc.target/aarch64/sync-op-acquire.x | 7 +++ gcc/testsuite/gcc.target/aarch64/sync-op-full.c | 8 +++ gcc/testsuite/gcc.target/aarch64/sync-op-full.x | 73 ++++++++++++++++++= ++++ gcc/testsuite/gcc.target/aarch64/sync-op-release.c | 6 ++ gcc/testsuite/gcc.target/aarch64/sync-op-release.x | 7 +++ 8 files changed, 130 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/sync-comp-swap.c create mode 100644 gcc/testsuite/gcc.target/aarch64/sync-comp-swap.x create mode 100644 gcc/testsuite/gcc.target/aarch64/sync-op-acquire.c create mode 100644 gcc/testsuite/gcc.target/aarch64/sync-op-acquire.x create mode 100644 gcc/testsuite/gcc.target/aarch64/sync-op-full.c create mode 100644 gcc/testsuite/gcc.target/aarch64/sync-op-full.x create mode 100644 gcc/testsuite/gcc.target/aarch64/sync-op-release.c create mode 100644 gcc/testsuite/gcc.target/aarch64/sync-op-release.x diff --git a/gcc/testsuite/gcc.target/aarch64/sync-comp-swap.c b/gcc/testsu= ite/gcc.target/aarch64/sync-comp-swap.c new file mode 100644 index 0000000..126b997 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sync-comp-swap.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-ipa-icf" } */ + +#include "sync-comp-swap.x" + +/* { dg-final { scan-assembler-times "ldxr\tw\[0-9\]+, \\\[x\[0-9\]+\\\]" = 2 } } */ +/* { dg-final { scan-assembler-times "stlxr\tw\[0-9\]+, w\[0-9\]+, \\\[x\[= 0-9\]+\\\]" 2 } } */ +/* { dg-final { scan-assembler-times "dmb\tish" 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sync-comp-swap.x b/gcc/testsu= ite/gcc.target/aarch64/sync-comp-swap.x new file mode 100644 index 0000000..eda52e40 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sync-comp-swap.x @@ -0,0 +1,13 @@ +int v =3D 0; + +int +sync_bool_compare_swap (int a, int b) +{ + return __sync_bool_compare_and_swap (&v, &a, &b); +} + +int +sync_val_compare_swap (int a, int b) +{ + return __sync_val_compare_and_swap (&v, &a, &b); +} diff --git a/gcc/testsuite/gcc.target/aarch64/sync-op-acquire.c b/gcc/tests= uite/gcc.target/aarch64/sync-op-acquire.c new file mode 100644 index 0000000..2639f9f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sync-op-acquire.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#include "sync-op-acquire.x" + +/* { dg-final { scan-assembler-times "ldxr\tw\[0-9\]+, \\\[x\[0-9\]+\\\]" = 1 } } */ +/* { dg-final { scan-assembler-times "stxr\tw\[0-9\]+, w\[0-9\]+, \\\[x\[0= -9\]+\\\]" 1 } } */ +/* { dg-final { scan-assembler-times "dmb\tish" 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sync-op-acquire.x b/gcc/tests= uite/gcc.target/aarch64/sync-op-acquire.x new file mode 100644 index 0000000..4c4548c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sync-op-acquire.x @@ -0,0 +1,7 @@ +int v; + +int +sync_lock_test_and_set (int a) +{ + return __sync_lock_test_and_set (&v, a); +} diff --git a/gcc/testsuite/gcc.target/aarch64/sync-op-full.c b/gcc/testsuit= e/gcc.target/aarch64/sync-op-full.c new file mode 100644 index 0000000..10fc8fc --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sync-op-full.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#include "sync-op-full.x" + +/* { dg-final { scan-assembler-times "ldxr\tw\[0-9\]+, \\\[x\[0-9\]+\\\]" = 12 } } */ +/* { dg-final { scan-assembler-times "stlxr\tw\[0-9\]+, w\[0-9\]+, \\\[x\[= 0-9\]+\\\]" 12 } } */ +/* { dg-final { scan-assembler-times "dmb\tish" 12 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sync-op-full.x b/gcc/testsuit= e/gcc.target/aarch64/sync-op-full.x new file mode 100644 index 0000000..c24223d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sync-op-full.x @@ -0,0 +1,73 @@ +int v =3D 0; + +int +sync_fetch_and_add (int a) +{ + return __sync_fetch_and_add (&v, a); +} + +int +sync_fetch_and_sub (int a) +{ + return __sync_fetch_and_sub (&v, a); +} + +int +sync_fetch_and_and (int a) +{ + return __sync_fetch_and_and (&v, a); +} + +int +sync_fetch_and_nand (int a) +{ + return __sync_fetch_and_nand (&v, a); +} + +int +sync_fetch_and_xor (int a) +{ + return __sync_fetch_and_xor (&v, a); +} + +int +sync_fetch_and_or (int a) +{ + return __sync_fetch_and_or (&v, a); +} + +int +sync_add_and_fetch (int a) +{ + return __sync_add_and_fetch (&v, a); +} + +int +sync_sub_and_fetch (int a) +{ + return __sync_sub_and_fetch (&v, a); +} + +int +sync_and_and_fetch (int a) +{ + return __sync_and_and_fetch (&v, a); +} + +int +sync_nand_and_fetch (int a) +{ + return __sync_nand_and_fetch (&v, a); +} + +int +sync_xor_and_fetch (int a) +{ + return __sync_xor_and_fetch (&v, a); +} + +int +sync_or_and_fetch (int a) +{ + return __sync_or_and_fetch (&v, a); +} diff --git a/gcc/testsuite/gcc.target/aarch64/sync-op-release.c b/gcc/tests= uite/gcc.target/aarch64/sync-op-release.c new file mode 100644 index 0000000..d25b46f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sync-op-release.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#include "sync-op-release.x" + +/* { dg-final { scan-assembler-times "stlr" 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sync-op-release.x b/gcc/tests= uite/gcc.target/aarch64/sync-op-release.x new file mode 100644 index 0000000..704bcff --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sync-op-release.x @@ -0,0 +1,7 @@ +int v; + +void +sync_lock_release (void) +{ + __sync_lock_release (&v); +} --=20 1.9.1 --------------080104050107000905050501--