From patchwork Tue Jan 13 15:18:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 43037 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 74F1820DE8 for ; Tue, 13 Jan 2015 15:24:52 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf2038892lab.3 for ; Tue, 13 Jan 2015 07:24:51 -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=PAaqVLnDifDhUtUKuE3jKzZTnyn3ozY5Myg69RmADlE=; b=Ytq2TgcePKf08epXuCWXFPGG+iCpHfuUOloIuaIjd2wgegzTOWAXlH25X+CpkxTZtg Izdr4EPTVYb4qDMRGT0I5v47iupSUEYrPSvKaTQ8Wr9E1smhKju5eKjHnSEwcE81SoQ8 fUy6WjvfSYD7RKG5APwMlvMgV1A2EYzIZH3yaSMLwKLZtk9KNLedD4iGM6K8IGM04KHy JMMAG71dGYTDKvPZgG2UiACAZxLxxhNo8xllocgjh7pRS8VUtZH+EOrcIEPNjNQqfYa8 ZUZpuNGpuKs9zM9vw/bdCkYe27VE/7w05v4F3n+sz/hzDInLM+VUnEyHu4pEaU760Wic eaBg== X-Gm-Message-State: ALoCoQkw0x6dukH8PkWz+4fXE24nNOQUt+cmEuh1JfWcUcOJMnbFMl2tXAP/g+5ZuX2AFbgkP1Rs X-Received: by 10.180.82.34 with SMTP id f2mr2940319wiy.1.1421162691326; Tue, 13 Jan 2015 07:24:51 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.132 with SMTP id n4ls6299lae.57.gmail; Tue, 13 Jan 2015 07:24:51 -0800 (PST) X-Received: by 10.152.87.100 with SMTP id w4mr43066870laz.71.1421162691173; Tue, 13 Jan 2015 07:24:51 -0800 (PST) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com. [2a00:1450:4010:c04::231]) by mx.google.com with ESMTPS id 2si3194617lai.59.2015.01.13.07.24.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 07:24:51 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::231 as permitted sender) client-ip=2a00:1450:4010:c04::231; Received: by mail-lb0-f177.google.com with SMTP id b6so3105334lbj.8 for ; Tue, 13 Jan 2015 07:24:51 -0800 (PST) X-Received: by 10.112.170.36 with SMTP id aj4mr42593847lbc.3.1421162691042; Tue, 13 Jan 2015 07:24:51 -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 c8csp1415017lbb; Tue, 13 Jan 2015 07:24:49 -0800 (PST) X-Received: by 10.68.202.1 with SMTP id ke1mr51990347pbc.139.1421162688992; Tue, 13 Jan 2015 07:24:48 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id ca1si27332051pdb.170.2015.01.13.07.24.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jan 2015 07:24:48 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-389046-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 25469 invoked by alias); 13 Jan 2015 15:19:41 -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 23838 invoked by uid 89); 13 Jan 2015 15:19:17 -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-wg0-f46.google.com Received: from mail-wg0-f46.google.com (HELO mail-wg0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 13 Jan 2015 15:19:15 +0000 Received: by mail-wg0-f46.google.com with SMTP id x13so3553008wgg.5 for ; Tue, 13 Jan 2015 07:19:12 -0800 (PST) X-Received: by 10.180.81.169 with SMTP id b9mr41455590wiy.41.1421162352374; Tue, 13 Jan 2015 07:19:12 -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.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jan 2015 07:19:11 -0800 (PST) From: Christophe Lyon To: gcc-patches@gcc.gnu.org Subject: [[ARM/AArch64][testsuite] 20/36] Add vsubw tests, putting most of the code in common with vaddw through vXXWw.inc Date: Tue, 13 Jan 2015 16:18:18 +0100 Message-Id: <1421162314-25779-21-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::231 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/vXXXw.inc: New file. * gcc.target/aarch64/advsimd-intrinsics/vsubw.c: New file. * gcc.target/aarch64/advsimd-intrinsics/vaddw.c: Use code from vXXXw.inc. diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vXXXw.inc b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vXXXw.inc new file mode 100644 index 0000000..c535557 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vXXXw.inc @@ -0,0 +1,70 @@ +#define FNNAME1(NAME) exec_ ## NAME +#define FNNAME(NAME) FNNAME1(NAME) + +void FNNAME (INSN_NAME) (void) +{ + /* Basic test: y=vaddw(x1,x2), then store the result. */ +#define TEST_VADDW1(INSN, T1, T2, W, W2, N) \ + VECT_VAR(vector_res, T1, W2, N) = \ + INSN##_##T2##W(VECT_VAR(vector, T1, W2, 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_VADDW(INSN, T1, T2, W, W2, N) \ + TEST_VADDW1(INSN, T1, T2, W, W2, N) + + DECL_VARIABLE(vector, int, 16, 8); + DECL_VARIABLE(vector, int, 32, 4); + DECL_VARIABLE(vector, int, 64, 2); + DECL_VARIABLE(vector, uint, 16, 8); + DECL_VARIABLE(vector, uint, 32, 4); + DECL_VARIABLE(vector, uint, 64, 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, q, int, s, 16, 8); + VLOAD(vector, buffer, q, int, s, 32, 4); + VLOAD(vector, buffer, q, int, s, 64, 2); + VLOAD(vector, buffer, q, uint, u, 16, 8); + VLOAD(vector, buffer, q, uint, u, 32, 4); + VLOAD(vector, buffer, q, uint, u, 64, 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_VADDW(INSN_NAME, int, s, 8, 16, 8); + TEST_VADDW(INSN_NAME, int, s, 16, 32, 4); + TEST_VADDW(INSN_NAME, int, s, 32, 64, 2); + TEST_VADDW(INSN_NAME, uint, u, 8, 16, 8); + TEST_VADDW(INSN_NAME, uint, u, 16, 32, 4); + TEST_VADDW(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/vaddw.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vaddw.c index 95cbb31..27f54f6 100644 --- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vaddw.c +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vaddw.c @@ -2,6 +2,9 @@ #include "arm-neon-ref.h" #include "compute-ref-data.h" +#define INSN_NAME vaddw +#define TEST_MSG "VADDW" + /* 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 vaddw -#define TEST_MSG "VADDW" - -#define FNNAME1(NAME) exec_ ## NAME -#define FNNAME(NAME) FNNAME1(NAME) - -void FNNAME (INSN_NAME) (void) -{ - /* Basic test: y=vaddw(x1,x2), then store the result. */ -#define TEST_VADDW1(INSN, T1, T2, W, W2, N) \ - VECT_VAR(vector_res, T1, W2, N) = \ - INSN##_##T2##W(VECT_VAR(vector, T1, W2, 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_VADDW(INSN, T1, T2, W, W2, N) \ - TEST_VADDW1(INSN, T1, T2, W, W2, N) - - DECL_VARIABLE(vector, int, 16, 8); - DECL_VARIABLE(vector, int, 32, 4); - DECL_VARIABLE(vector, int, 64, 2); - DECL_VARIABLE(vector, uint, 16, 8); - DECL_VARIABLE(vector, uint, 32, 4); - DECL_VARIABLE(vector, uint, 64, 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, q, int, s, 16, 8); - VLOAD(vector, buffer, q, int, s, 32, 4); - VLOAD(vector, buffer, q, int, s, 64, 2); - VLOAD(vector, buffer, q, uint, u, 16, 8); - VLOAD(vector, buffer, q, uint, u, 32, 4); - VLOAD(vector, buffer, q, uint, u, 64, 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_VADDW(INSN_NAME, int, s, 8, 16, 8); - TEST_VADDW(INSN_NAME, int, s, 16, 32, 4); - TEST_VADDW(INSN_NAME, int, s, 32, 64, 2); - TEST_VADDW(INSN_NAME, uint, u, 8, 16, 8); - TEST_VADDW(INSN_NAME, uint, u, 16, 32, 4); - TEST_VADDW(INSN_NAME, uint, u, 32, 64, 2); - - CHECK_RESULTS (TEST_MSG, ""); -} - -int main (void) -{ - FNNAME (INSN_NAME) (); - return 0; -} +#include "vXXXw.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vsubw.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vsubw.c new file mode 100644 index 0000000..3e8bc98 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vsubw.c @@ -0,0 +1,50 @@ +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +#define INSN_NAME vsubw +#define TEST_MSG "VSUBW" + +/* 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) [] = { 0xfefd, 0xfefe, 0xfeff, 0xff00, + 0xff01, 0xff02, 0xff03, 0xff04 }; +VECT_VAR_DECL(expected,uint,32,4) [] = { 0xfffeffff, 0xffff0000, + 0xffff0001, 0xffff0002 }; +VECT_VAR_DECL(expected,uint,64,2) [] = { 0xffffffff00000000, + 0xffffffff00000001 }; +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 "vXXXw.inc"