From patchwork Wed May 11 13:23:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 67521 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp225226qge; Wed, 11 May 2016 06:26:36 -0700 (PDT) X-Received: by 10.66.164.68 with SMTP id yo4mr4881771pab.157.1462973196365; Wed, 11 May 2016 06:26:36 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z62si9674001pfi.48.2016.05.11.06.26.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 May 2016 06:26:36 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-427071-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-427071-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-427071-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=rWVc9JL4eYfPkFmNA7Bu23gegSURqUc4IJVALpWRtjaqE4P189Cwa 0X0vrq7feK6c/Sj5MJmj3v+MfGWagDIcVP4PuLC+AihHuLh0li+tpKTCmWLM2jWe fn5G3N3zwqKrM6rbeMCPiRv9VM8WxlK62SVPtgb57862PPWInM9R5Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references; s=default; bh=mle5gQsLwrUr98bVpdERNFyHYJ4=; b=W+iZSlff0hmiBkqZZIYf+egGqPJ7 xT9oqiZPwceLAtobfkIl6SEj7eVd2n43IvVZlZKvc3wd+xWZ6pdKMNwJdsiNqshJ 0nbVFJLPt5dbLD0Q9S21059NVxFFKnKZJGo3+P3wgxh4VsNqLcwuK+e4fXPB45es CKbQDNpsnhMfoKA= Received: (qmail 83817 invoked by alias); 11 May 2016 13:24:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 83359 invoked by uid 89); 11 May 2016 13:24:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, GAPPY_SUBJECT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-wm0-f48.google.com Received: from mail-wm0-f48.google.com (HELO mail-wm0-f48.google.com) (74.125.82.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 11 May 2016 13:24:06 +0000 Received: by mail-wm0-f48.google.com with SMTP id g17so82523678wme.1 for ; Wed, 11 May 2016 06:24:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=FgfstnW/ElO7usF20dx9IomO4R9DiHH+mjYPsfnhQkM=; b=UcwhktObh9mf897y3Xbw5ogGEViOiHEKT505NXntXJq9JhyzvctQg+0zXc6ZuqwXOo gj+hr2DLhDL3d2SbYGEW5tD0Lb6JeDjdY4HbCCuJsT/1aRxvO1ntJ70ZL+VAqDa3aKPp 1H46LFqSMXUscwOu1bXYM0jAt8c7S/bSF3EGUXZviTDo4HWjjFDq/w8oqVZvFXfmJFKq 1AEEyiQvjyGrjhM5pa/si6Dm0I/V8kuoy8UGrR0YVEndZKqR6nx0pCi9Do1LEweT4PTD Drta9yfeBHlRQ7cGHAGQvwTOZ+Rs7LR7GSDW6E1NKieU+XclDQ/tbW1wS3Bn8yDNzeQI 8Lew== X-Gm-Message-State: AOPr4FXWkLw8w8k6LedgS9wzT+z5V0ZB4ck20Bt+q5MA4h9yNzTWYNfgN5+z/a/Gp8+cHBh/ X-Received: by 10.28.8.213 with SMTP id 204mr38712wmi.93.1462973043200; Wed, 11 May 2016 06:24:03 -0700 (PDT) Received: from gnx2647.guests.st.com (29-39.80-90.static-ip.oleane.fr. [90.80.39.29]) by smtp.gmail.com with ESMTPSA id u6sm35876719wmd.21.2016.05.11.06.24.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 May 2016 06:24:02 -0700 (PDT) From: Christophe Lyon To: gcc-patches@gcc.gnu.org Subject: [Patch ARM/AArch64 09/11] Add missing vrnd{,a,m,n,p,x} tests. Date: Wed, 11 May 2016 15:23:59 +0200 Message-Id: <1462973041-7911-10-git-send-email-christophe.lyon@linaro.org> In-Reply-To: <1462973041-7911-1-git-send-email-christophe.lyon@linaro.org> References: <1462973041-7911-1-git-send-email-christophe.lyon@linaro.org> X-IsSubscribed: yes 2016-05-02 Christophe Lyon * gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrnd.c: New. * gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndX.inc: New. * gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrnda.c: New. * gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndm.c: New. * gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndn.c: New. * gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndp.c: New. * gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndx.c: New. Change-Id: Iab5f98dc4b15f9a2f61b622a9f62b207872f1737 -- 1.9.1 diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrnd.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrnd.c new file mode 100644 index 0000000..5f492d4 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrnd.c @@ -0,0 +1,16 @@ +/* { dg-require-effective-target arm_v8_neon_ok } */ +/* { dg-add-options arm_v8_neon } */ + +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL (expected, hfloat, 32, 2) [] = { 0xc1800000, 0xc1700000 }; +VECT_VAR_DECL (expected, hfloat, 32, 4) [] = { 0xc1800000, 0xc1700000, + 0xc1600000, 0xc1500000 }; + +#define INSN vrnd +#define TEST_MSG "VRND" + +#include "vrndX.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndX.inc b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndX.inc new file mode 100644 index 0000000..629240d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndX.inc @@ -0,0 +1,43 @@ +#define FNNAME1(NAME) exec_ ## NAME +#define FNNAME(NAME) FNNAME1 (NAME) + +void FNNAME (INSN) (void) +{ + /* vector_res = vrndX (vector), then store the result. */ +#define TEST_VRND2(INSN, Q, T1, T2, W, N) \ + VECT_VAR (vector_res, T1, W, N) = \ + INSN##Q##_##T2##W (VECT_VAR (vector, T1, W, N)); \ + vst1##Q##_##T2##W (VECT_VAR (result, T1, W, N), \ + VECT_VAR (vector_res, T1, W, N)) + + /* Two auxliary macros are necessary to expand INSN. */ +#define TEST_VRND1(INSN, Q, T1, T2, W, N) \ + TEST_VRND2 (INSN, Q, T1, T2, W, N) + +#define TEST_VRND(Q, T1, T2, W, N) \ + TEST_VRND1 (INSN, Q, T1, T2, W, N) + + DECL_VARIABLE (vector, float, 32, 2); + DECL_VARIABLE (vector, float, 32, 4); + + DECL_VARIABLE (vector_res, float, 32, 2); + DECL_VARIABLE (vector_res, float, 32, 4); + + clean_results (); + + VLOAD (vector, buffer, , float, f, 32, 2); + VLOAD (vector, buffer, q, float, f, 32, 4); + + TEST_VRND ( , float, f, 32, 2); + TEST_VRND (q, float, f, 32, 4); + + CHECK_FP (TEST_MSG, float, 32, 2, PRIx32, expected, ""); + CHECK_FP (TEST_MSG, float, 32, 4, PRIx32, expected, ""); +} + +int +main (void) +{ + FNNAME (INSN) (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrnda.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrnda.c new file mode 100644 index 0000000..816fd28d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrnda.c @@ -0,0 +1,16 @@ +/* { dg-require-effective-target arm_v8_neon_ok } */ +/* { dg-add-options arm_v8_neon } */ + +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL (expected, hfloat, 32, 2) [] = { 0xc1800000, 0xc1700000 }; +VECT_VAR_DECL (expected, hfloat, 32, 4) [] = { 0xc1800000, 0xc1700000, + 0xc1600000, 0xc1500000 }; + +#define INSN vrnda +#define TEST_MSG "VRNDA" + +#include "vrndX.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndm.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndm.c new file mode 100644 index 0000000..029880c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndm.c @@ -0,0 +1,16 @@ +/* { dg-require-effective-target arm_v8_neon_ok } */ +/* { dg-add-options arm_v8_neon } */ + +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL (expected, hfloat, 32, 2) [] = { 0xc1800000, 0xc1700000 }; +VECT_VAR_DECL (expected, hfloat, 32, 4) [] = { 0xc1800000, 0xc1700000, + 0xc1600000, 0xc1500000 }; + +#define INSN vrndm +#define TEST_MSG "VRNDM" + +#include "vrndX.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndn.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndn.c new file mode 100644 index 0000000..571243c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndn.c @@ -0,0 +1,16 @@ +/* { dg-require-effective-target arm_v8_neon_ok } */ +/* { dg-add-options arm_v8_neon } */ + +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL (expected, hfloat, 32, 2) [] = { 0xc1800000, 0xc1700000 }; +VECT_VAR_DECL (expected, hfloat, 32, 4) [] = { 0xc1800000, 0xc1700000, + 0xc1600000, 0xc1500000 }; + +#define INSN vrndn +#define TEST_MSG "VRNDN" + +#include "vrndX.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndp.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndp.c new file mode 100644 index 0000000..ff4771c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndp.c @@ -0,0 +1,16 @@ +/* { dg-require-effective-target arm_v8_neon_ok } */ +/* { dg-add-options arm_v8_neon } */ + +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL (expected, hfloat, 32, 2) [] = { 0xc1800000, 0xc1700000 }; +VECT_VAR_DECL (expected, hfloat, 32, 4) [] = { 0xc1800000, 0xc1700000, + 0xc1600000, 0xc1500000 }; + +#define INSN vrndp +#define TEST_MSG "VRNDP" + +#include "vrndX.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndx.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndx.c new file mode 100644 index 0000000..ff2357b --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vrndx.c @@ -0,0 +1,16 @@ +/* { dg-require-effective-target arm_v8_neon_ok } */ +/* { dg-add-options arm_v8_neon } */ + +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL (expected, hfloat, 32, 2) [] = { 0xc1800000, 0xc1700000 }; +VECT_VAR_DECL (expected, hfloat, 32, 4) [] = { 0xc1800000, 0xc1700000, + 0xc1600000, 0xc1500000 }; + +#define INSN vrndx +#define TEST_MSG "VRNDX" + +#include "vrndX.inc"