From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25832 invoked by alias); 13 Jan 2015 15:19:44 -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 24300 invoked by uid 89); 13 Jan 2015 15:19:21 -0000 Authentication-Results: sourceware.org; auth=none 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-f49.google.com Received: from mail-wg0-f49.google.com (HELO mail-wg0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 13 Jan 2015 15:19:19 +0000 Received: by mail-wg0-f49.google.com with SMTP id n12so3555763wgh.8 for ; Tue, 13 Jan 2015 07:19:16 -0800 (PST) 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=zej4dDhbdjlGeBqar6s0sdf+cjtEdrRs8Bx9rsGqG5o=; b=hVdHhAu1EITNPLc3mFlxN62n95I0Yy1jTIZFM8mKVlmhij/pdRplV5ytqdbdIrBvmF UW/JLt8S4SzRbwgYyfFllvixn5Nh5SSyDUVtVowCAxPZK/wEl6Kd39OhH317+hDWa2rU F9aMApEckmLOJXYdo8vmelv0xmnUoNZ88WxcrdZuJRV3h8N4AVEbxJ8e9nUaGypf1RIA 9iG+WfUugAQ4xK81ADoLjRvsb25LZ3BAJLgLDm3ah3wDsDd3sVmKmVWGjenoKud0l1Tf 5hkZwi7YG0OZvTAMedvsXttjQhcVva7u05mqF79iAdpFGvjYzWfAoFYeb1wsM+nPWU+B wvQw== X-Gm-Message-State: ALoCoQnvTLWknu/rPBevOTQ1Ut9ip6PYHbMgr3uFsfZW03tuCvGv4D8GVg6OEoN2tRjMnqhGHoXs X-Received: by 10.180.103.40 with SMTP id ft8mr40526338wib.68.1421162356087; Tue, 13 Jan 2015 07:19:16 -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.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jan 2015 07:19:15 -0800 (PST) From: Christophe Lyon To: gcc-patches@gcc.gnu.org Subject: [[ARM/AArch64][testsuite] 23/36] Add vmul_lane tests. Date: Tue, 13 Jan 2015 15:19:00 -0000 Message-Id: <1421162314-25779-24-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-SW-Source: 2015-01/txt/msg00863.txt.bz2 * gcc.target/aarch64/advsimd-intrinsics/vmul_lane.c: New file. diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vmul_lane.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vmul_lane.c new file mode 100644 index 0000000..978cd9b --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vmul_lane.c @@ -0,0 +1,104 @@ +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL(expected,int,16,4) [] = { 0xffc0, 0xffc4, 0xffc8, 0xffcc }; +VECT_VAR_DECL(expected,int,32,2) [] = { 0xfffffde0, 0xfffffe02 }; +VECT_VAR_DECL(expected,uint,16,4) [] = { 0xbbc0, 0xc004, 0xc448, 0xc88c }; +VECT_VAR_DECL(expected,uint,32,2) [] = { 0xfffface0, 0xffffb212 }; +VECT_VAR_DECL(expected,hfloat,32,2) [] = { 0xc3b66666, 0xc3ab0000 }; +VECT_VAR_DECL(expected,int,16,8) [] = { 0xffc0, 0xffc4, 0xffc8, 0xffcc, + 0xffd0, 0xffd4, 0xffd8, 0xffdc }; +VECT_VAR_DECL(expected,int,32,4) [] = { 0xfffffde0, 0xfffffe02, + 0xfffffe24, 0xfffffe46 }; +VECT_VAR_DECL(expected,uint,16,8) [] = { 0xbbc0, 0xc004, 0xc448, 0xc88c, + 0xccd0, 0xd114, 0xd558, 0xd99c }; +VECT_VAR_DECL(expected,uint,32,4) [] = { 0xfffface0, 0xffffb212, + 0xffffb744, 0xffffbc76 }; +VECT_VAR_DECL(expected,hfloat,32,4) [] = { 0xc3b66666, 0xc3ab0000, + 0xc39f9999, 0xc3943333 }; + +#define TEST_MSG "VMUL_LANE" +void exec_vmul_lane (void) +{ +#define DECL_VMUL(VAR) \ + DECL_VARIABLE(VAR, int, 16, 4); \ + DECL_VARIABLE(VAR, int, 32, 2); \ + DECL_VARIABLE(VAR, uint, 16, 4); \ + DECL_VARIABLE(VAR, uint, 32, 2); \ + DECL_VARIABLE(VAR, float, 32, 2); \ + DECL_VARIABLE(VAR, int, 16, 8); \ + DECL_VARIABLE(VAR, int, 32, 4); \ + DECL_VARIABLE(VAR, uint, 16, 8); \ + DECL_VARIABLE(VAR, uint, 32, 4); \ + DECL_VARIABLE(VAR, float, 32, 4) + + /* vector_res = vmul_lane(vector,vector2,lane), then store the result. */ +#define TEST_VMUL_LANE(Q, T1, T2, W, N, N2, L) \ + VECT_VAR(vector_res, T1, W, N) = \ + vmul##Q##_lane_##T2##W(VECT_VAR(vector, T1, W, N), \ + VECT_VAR(vector2, T1, W, N2), \ + L); \ + vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ + VECT_VAR(vector_res, T1, W, N)) + + DECL_VMUL(vector); + DECL_VMUL(vector_res); + + DECL_VARIABLE(vector2, int, 16, 4); + DECL_VARIABLE(vector2, int, 32, 2); + DECL_VARIABLE(vector2, uint, 16, 4); + DECL_VARIABLE(vector2, uint, 32, 2); + DECL_VARIABLE(vector2, float, 32, 2); + + clean_results (); + + /* Initialize vector from pre-initialized values. */ + VLOAD(vector, buffer, , int, s, 16, 4); + VLOAD(vector, buffer, , int, s, 32, 2); + VLOAD(vector, buffer, , uint, u, 16, 4); + VLOAD(vector, buffer, , uint, u, 32, 2); + VLOAD(vector, buffer, , float, f, 32, 2); + VLOAD(vector, buffer, q, int, s, 16, 8); + VLOAD(vector, buffer, q, int, s, 32, 4); + VLOAD(vector, buffer, q, uint, u, 16, 8); + VLOAD(vector, buffer, q, uint, u, 32, 4); + VLOAD(vector, buffer, q, float, f, 32, 4); + + /* Initialize vector2. */ + VDUP(vector2, , int, s, 16, 4, 0x4); + VDUP(vector2, , int, s, 32, 2, 0x22); + VDUP(vector2, , uint, u, 16, 4, 0x444); + VDUP(vector2, , uint, u, 32, 2, 0x532); + VDUP(vector2, , float, f, 32, 2, 22.8f); + + /* Choose lane arbitrarily. */ + TEST_VMUL_LANE(, int, s, 16, 4, 4, 2); + TEST_VMUL_LANE(, int, s, 32, 2, 2, 1); + TEST_VMUL_LANE(, uint, u, 16, 4, 4, 2); + TEST_VMUL_LANE(, uint, u, 32, 2, 2, 1); + TEST_VMUL_LANE(, float, f, 32, 2, 2, 1); + TEST_VMUL_LANE(q, int, s, 16, 8, 4, 2); + TEST_VMUL_LANE(q, int, s, 32, 4, 2, 0); + TEST_VMUL_LANE(q, uint, u, 16, 8, 4, 2); + TEST_VMUL_LANE(q, uint, u, 32, 4, 2, 1); + TEST_VMUL_LANE(q, float, f, 32, 4, 2, 0); + + CHECK(TEST_MSG, int, 16, 4, PRIx64, expected, ""); + CHECK(TEST_MSG, int, 32, 2, PRIx32, expected, ""); + CHECK(TEST_MSG, uint, 16, 4, PRIx64, expected, ""); + CHECK(TEST_MSG, uint, 32, 2, PRIx32, expected, ""); + CHECK_FP(TEST_MSG, float, 32, 2, PRIx32, expected, ""); + CHECK(TEST_MSG, int, 16, 8, PRIx64, expected, ""); + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, ""); + CHECK(TEST_MSG, uint, 16, 8, PRIx64, expected, ""); + CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, ""); + CHECK_FP(TEST_MSG, float, 32, 4, PRIx32, expected, ""); +} + +int main (void) +{ + exec_vmul_lane (); + return 0; +} -- 2.1.0