From patchwork Tue Jan 13 15:18:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 43036 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DE5F820DE8 for ; Tue, 13 Jan 2015 15:24:36 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id a1sf2027783wgh.3 for ; Tue, 13 Jan 2015 07:24:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:sender:delivered-to:from:to:subject:date:message-id :in-reply-to:references:x-original-sender :x-original-authentication-results; bh=lhk31MIaRiADpHjGmbSrcTy/O65uSf1qWAn+JHRrArI=; b=dz3/ZPMJOxfeD/zHRr/MtdCjilOA49SElX/VA+e7GRjMrkyqEbGOhKMiURKwI81/FC YGfXj/9Ik6klW8DW/xpMdQCfa31+ESdTKTQiXFTV1XN071LdOw4nwfZa67faLsHI9YRy 0NGfilU8SKSzBiXnSl3FJecaV6PUyzDlm3r+TQJMZMfvq67PpC7eUlWRB7lnPZR2owxq qTfqAgedOH7ozV8AYzdc0MdJktI7zbEWy7eNzx7FnnOG5oxD6eIrsJxQ7sbEnnWRx5PI Wr0b5ngbJ/vFO9T5tKIH3OB+erPLU9ECG0o4IwxU/b2FzGGFnsiY9h/sjlsEKn77I2QL GiNg== X-Gm-Message-State: ALoCoQn2wKUUpRmCPcGuzlaI5RFqfuxgcgV/X0zqAS5qaaXVaQ0x9G1EFAoft904a3fhCMkP6sip X-Received: by 10.112.147.195 with SMTP id tm3mr367028lbb.18.1421162676009; Tue, 13 Jan 2015 07:24:36 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.66 with SMTP id le2ls5743lac.90.gmail; Tue, 13 Jan 2015 07:24:35 -0800 (PST) X-Received: by 10.152.21.134 with SMTP id v6mr42773938lae.13.1421162675877; Tue, 13 Jan 2015 07:24:35 -0800 (PST) Received: from mail-lb0-x22b.google.com (mail-lb0-x22b.google.com. [2a00:1450:4010:c04::22b]) by mx.google.com with ESMTPS id ga1si24482899lbc.122.2015.01.13.07.24.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 07:24:35 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22b as permitted sender) client-ip=2a00:1450:4010:c04::22b; Received: by mail-lb0-f171.google.com with SMTP id w7so3146587lbi.2 for ; Tue, 13 Jan 2015 07:24:35 -0800 (PST) X-Received: by 10.112.180.135 with SMTP id do7mr42205921lbc.23.1421162675782; Tue, 13 Jan 2015 07:24:35 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp1414961lbb; Tue, 13 Jan 2015 07:24:34 -0800 (PST) X-Received: by 10.68.125.163 with SMTP id mr3mr51219598pbb.99.1421162673496; Tue, 13 Jan 2015 07:24:33 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z9si27243545par.226.2015.01.13.07.24.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jan 2015 07:24:33 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-389045-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 25393 invoked by alias); 13 Jan 2015 15:19:38 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 23700 invoked by uid 89); 13 Jan 2015 15:19:16 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f173.google.com Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com) (209.85.212.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 13 Jan 2015 15:19:14 +0000 Received: by mail-wi0-f173.google.com with SMTP id em10so6194167wid.0 for ; Tue, 13 Jan 2015 07:19:11 -0800 (PST) X-Received: by 10.194.2.75 with SMTP id 11mr17540425wjs.78.1421162351098; Tue, 13 Jan 2015 07:19:11 -0800 (PST) Received: from babel.clyon.hd.free.fr (vig38-2-82-225-222-175.fbx.proxad.net. [82.225.222.175]) by mx.google.com with ESMTPSA id jr4sm26100313wjc.20.2015.01.13.07.19.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jan 2015 07:19:10 -0800 (PST) From: Christophe Lyon To: gcc-patches@gcc.gnu.org Subject: [[ARM/AArch64][testsuite] 19/36] Add vsubl tests, put most of the code in common with vaddl in vXXXl.inc. Date: Tue, 13 Jan 2015 16:18:17 +0100 Message-Id: <1421162314-25779-20-git-send-email-christophe.lyon@linaro.org> In-Reply-To: <1421162314-25779-1-git-send-email-christophe.lyon@linaro.org> References: <1421162314-25779-1-git-send-email-christophe.lyon@linaro.org> X-IsSubscribed: yes X-Original-Sender: christophe.lyon@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22b as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 * gcc.target/aarch64/advsimd-intrinsics/vXXXl.inc: New file. * gcc.target/aarch64/advsimd-intrinsics/vsubl.c: New file. * gcc.target/aarch64/advsimd-intrinsics/vaddl.c: Use code from vXXXl.inc. diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vXXXl.inc b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vXXXl.inc new file mode 100644 index 0000000..bd4c8fb --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vXXXl.inc @@ -0,0 +1,70 @@ +#define FNNAME1(NAME) exec_ ## NAME +#define FNNAME(NAME) FNNAME1(NAME) + +void FNNAME (INSN_NAME) (void) +{ + /* Basic test: y=vaddl(x1,x2), then store the result. */ +#define TEST_VADDL1(INSN, T1, T2, W, W2, N) \ + VECT_VAR(vector_res, T1, W2, N) = \ + INSN##_##T2##W(VECT_VAR(vector, T1, W, N), \ + VECT_VAR(vector2, T1, W, N)); \ + vst1q_##T2##W2(VECT_VAR(result, T1, W2, N), VECT_VAR(vector_res, T1, W2, N)) + +#define TEST_VADDL(INSN, T1, T2, W, W2, N) \ + TEST_VADDL1(INSN, T1, T2, W, W2, N) + + DECL_VARIABLE(vector, int, 8, 8); + DECL_VARIABLE(vector, int, 16, 4); + DECL_VARIABLE(vector, int, 32, 2); + DECL_VARIABLE(vector, uint, 8, 8); + DECL_VARIABLE(vector, uint, 16, 4); + DECL_VARIABLE(vector, uint, 32, 2); + + DECL_VARIABLE(vector2, int, 8, 8); + DECL_VARIABLE(vector2, int, 16, 4); + DECL_VARIABLE(vector2, int, 32, 2); + DECL_VARIABLE(vector2, uint, 8, 8); + DECL_VARIABLE(vector2, uint, 16, 4); + DECL_VARIABLE(vector2, uint, 32, 2); + + DECL_VARIABLE(vector_res, int, 16, 8); + DECL_VARIABLE(vector_res, int, 32, 4); + DECL_VARIABLE(vector_res, int, 64, 2); + DECL_VARIABLE(vector_res, uint, 16, 8); + DECL_VARIABLE(vector_res, uint, 32, 4); + DECL_VARIABLE(vector_res, uint, 64, 2); + + clean_results (); + + /* Initialize input "vector" from "buffer". */ + VLOAD(vector, buffer, , int, s, 8, 8); + VLOAD(vector, buffer, , int, s, 16, 4); + VLOAD(vector, buffer, , int, s, 32, 2); + VLOAD(vector, buffer, , uint, u, 8, 8); + VLOAD(vector, buffer, , uint, u, 16, 4); + VLOAD(vector, buffer, , uint, u, 32, 2); + + /* Choose init value arbitrarily. */ + VDUP(vector2, , int, s, 8, 8, -13); + VDUP(vector2, , int, s, 16, 4, -14); + VDUP(vector2, , int, s, 32, 2, -16); + VDUP(vector2, , uint, u, 8, 8, 0xf3); + VDUP(vector2, , uint, u, 16, 4, 0xfff1); + VDUP(vector2, , uint, u, 32, 2, 0xfffffff0); + + /* Execute the tests. */ + TEST_VADDL(INSN_NAME, int, s, 8, 16, 8); + TEST_VADDL(INSN_NAME, int, s, 16, 32, 4); + TEST_VADDL(INSN_NAME, int, s, 32, 64, 2); + TEST_VADDL(INSN_NAME, uint, u, 8, 16, 8); + TEST_VADDL(INSN_NAME, uint, u, 16, 32, 4); + TEST_VADDL(INSN_NAME, uint, u, 32, 64, 2); + + CHECK_RESULTS (TEST_MSG, ""); +} + +int main (void) +{ + FNNAME (INSN_NAME) (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vaddl.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vaddl.c index 030785d..020d9f8 100644 --- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vaddl.c +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vaddl.c @@ -2,6 +2,9 @@ #include "arm-neon-ref.h" #include "compute-ref-data.h" +#define INSN_NAME vaddl +#define TEST_MSG "VADDL" + /* Expected results. */ VECT_VAR_DECL(expected,int,8,8) [] = { 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33 }; @@ -45,76 +48,4 @@ VECT_VAR_DECL(expected,poly,16,8) [] = { 0x3333, 0x3333, 0x3333, 0x3333, VECT_VAR_DECL(expected,hfloat,32,4) [] = { 0x33333333, 0x33333333, 0x33333333, 0x33333333 }; -#define INSN_NAME vaddl -#define TEST_MSG "VADDL" - -#define FNNAME1(NAME) exec_ ## NAME -#define FNNAME(NAME) FNNAME1(NAME) - -void FNNAME (INSN_NAME) (void) -{ - /* Basic test: y=vaddl(x1,x2), then store the result. */ -#define TEST_VADDL1(INSN, T1, T2, W, W2, N) \ - VECT_VAR(vector_res, T1, W2, N) = \ - INSN##_##T2##W(VECT_VAR(vector, T1, W, N), \ - VECT_VAR(vector2, T1, W, N)); \ - vst1q_##T2##W2(VECT_VAR(result, T1, W2, N), VECT_VAR(vector_res, T1, W2, N)) - -#define TEST_VADDL(INSN, T1, T2, W, W2, N) \ - TEST_VADDL1(INSN, T1, T2, W, W2, N) - - DECL_VARIABLE(vector, int, 8, 8); - DECL_VARIABLE(vector, int, 16, 4); - DECL_VARIABLE(vector, int, 32, 2); - DECL_VARIABLE(vector, uint, 8, 8); - DECL_VARIABLE(vector, uint, 16, 4); - DECL_VARIABLE(vector, uint, 32, 2); - - DECL_VARIABLE(vector2, int, 8, 8); - DECL_VARIABLE(vector2, int, 16, 4); - DECL_VARIABLE(vector2, int, 32, 2); - DECL_VARIABLE(vector2, uint, 8, 8); - DECL_VARIABLE(vector2, uint, 16, 4); - DECL_VARIABLE(vector2, uint, 32, 2); - - DECL_VARIABLE(vector_res, int, 16, 8); - DECL_VARIABLE(vector_res, int, 32, 4); - DECL_VARIABLE(vector_res, int, 64, 2); - DECL_VARIABLE(vector_res, uint, 16, 8); - DECL_VARIABLE(vector_res, uint, 32, 4); - DECL_VARIABLE(vector_res, uint, 64, 2); - - clean_results (); - - /* Initialize input "vector" from "buffer". */ - VLOAD(vector, buffer, , int, s, 8, 8); - VLOAD(vector, buffer, , int, s, 16, 4); - VLOAD(vector, buffer, , int, s, 32, 2); - VLOAD(vector, buffer, , uint, u, 8, 8); - VLOAD(vector, buffer, , uint, u, 16, 4); - VLOAD(vector, buffer, , uint, u, 32, 2); - - /* Choose init value arbitrarily. */ - VDUP(vector2, , int, s, 8, 8, -13); - VDUP(vector2, , int, s, 16, 4, -14); - VDUP(vector2, , int, s, 32, 2, -16); - VDUP(vector2, , uint, u, 8, 8, 0xf3); - VDUP(vector2, , uint, u, 16, 4, 0xfff1); - VDUP(vector2, , uint, u, 32, 2, 0xfffffff0); - - /* Execute the tests. */ - TEST_VADDL(INSN_NAME, int, s, 8, 16, 8); - TEST_VADDL(INSN_NAME, int, s, 16, 32, 4); - TEST_VADDL(INSN_NAME, int, s, 32, 64, 2); - TEST_VADDL(INSN_NAME, uint, u, 8, 16, 8); - TEST_VADDL(INSN_NAME, uint, u, 16, 32, 4); - TEST_VADDL(INSN_NAME, uint, u, 32, 64, 2); - - CHECK_RESULTS (TEST_MSG, ""); -} - -int main (void) -{ - FNNAME (INSN_NAME) (); - return 0; -} +#include "vXXXl.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vsubl.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vsubl.c new file mode 100644 index 0000000..b765b2b --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vsubl.c @@ -0,0 +1,48 @@ +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +#define INSN_NAME vsubl +#define TEST_MSG "VSUBL" + +/* Expected results. */ +VECT_VAR_DECL(expected,int,8,8) [] = { 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33 }; +VECT_VAR_DECL(expected,int,16,4) [] = { 0x3333, 0x3333, 0x3333, 0x3333 }; +VECT_VAR_DECL(expected,int,32,2) [] = { 0x33333333, 0x33333333 }; +VECT_VAR_DECL(expected,int,64,1) [] = { 0x3333333333333333 }; +VECT_VAR_DECL(expected,uint,8,8) [] = { 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33 }; +VECT_VAR_DECL(expected,uint,16,4) [] = { 0x3333, 0x3333, 0x3333, 0x3333 }; +VECT_VAR_DECL(expected,uint,32,2) [] = { 0x33333333, 0x33333333 }; +VECT_VAR_DECL(expected,uint,64,1) [] = { 0x3333333333333333 }; +VECT_VAR_DECL(expected,poly,8,8) [] = { 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33 }; +VECT_VAR_DECL(expected,poly,16,4) [] = { 0x3333, 0x3333, 0x3333, 0x3333 }; +VECT_VAR_DECL(expected,hfloat,32,2) [] = { 0x33333333, 0x33333333 }; +VECT_VAR_DECL(expected,int,8,16) [] = { 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33 }; +VECT_VAR_DECL(expected,int,16,8) [] = { 0xfffd, 0xfffe, 0xffff, 0x0, + 0x1, 0x2, 0x3, 0x4 }; +VECT_VAR_DECL(expected,int,32,4) [] = { 0xfffffffe, 0xffffffff, 0x0, 0x1 }; +VECT_VAR_DECL(expected,int,64,2) [] = { 0x0, 0x1 }; +VECT_VAR_DECL(expected,uint,8,16) [] = { 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33 }; +VECT_VAR_DECL(expected,uint,16,8) [] = { 0xfffd, 0xfffe, 0xffff, 0x0, + 0x1, 0x2, 0x3, 0x4 }; +VECT_VAR_DECL(expected,uint,32,4) [] = { 0xffffffff, 0x0, 0x1, 0x2 }; +VECT_VAR_DECL(expected,uint,64,2) [] = { 0x0, 0x1 }; +VECT_VAR_DECL(expected,poly,8,16) [] = { 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33 }; +VECT_VAR_DECL(expected,poly,16,8) [] = { 0x3333, 0x3333, 0x3333, 0x3333, + 0x3333, 0x3333, 0x3333, 0x3333 }; +VECT_VAR_DECL(expected,hfloat,32,4) [] = { 0x33333333, 0x33333333, + 0x33333333, 0x33333333 }; + +#include "vXXXl.inc"