From patchwork Tue Jan 13 15:18:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 43022 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EF54A20DE8 for ; Tue, 13 Jan 2015 15:20:40 +0000 (UTC) Received: by mail-we0-f197.google.com with SMTP id w61sf2022449wes.0 for ; Tue, 13 Jan 2015 07:20:40 -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=Dn6mGw82XJid3MAFicHESHKy3txoc2edIUnF4q80tcs=; b=LZ+c+SJrpc3A5QjDToYr851znD6BGEU6yvCjK+Nl+pdjy6TP5zx1Ojve7Qm3gehA+x CIFcfSdu+fv7Nij0aOK6x2Mc0I/pjQxz4BRMVBU4+UPg/OhV1WOX2nGIIaZbHN+s5Wd+ DuzkTRqLkU3YgktjbhDsXY14wlzBIaEMzSS8RovCjQ8CEbUDnAAnSJC5D5uiGvF4if2E 7EluxJNj15MArsLJfTu4abW/KJen8ptmVgrm/bsAdoGBDp29s0ZTyWIrly7HzOz8qqm2 ST2G57pQIgz+P7wbVfIpvinr4CqwVMDgrdLQEr/vdvvgj7TuURz2v+j26EPuJT6Eexos ul1g== X-Gm-Message-State: ALoCoQmriKobATa+AnvRfP/GaUuZK2FxalogY8Xg1UhNREFBG8/vjrNwhlmtX0r4gl50GQa+7W0e X-Received: by 10.180.77.167 with SMTP id t7mr2938215wiw.6.1421162440217; Tue, 13 Jan 2015 07:20:40 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.26.200 with SMTP id n8ls8781lag.15.gmail; Tue, 13 Jan 2015 07:20:40 -0800 (PST) X-Received: by 10.112.41.234 with SMTP id i10mr43511506lbl.25.1421162440048; Tue, 13 Jan 2015 07:20:40 -0800 (PST) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com. [2a00:1450:4010:c03::22e]) by mx.google.com with ESMTPS id df8si3234415lac.23.2015.01.13.07.20.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 07:20:39 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22e as permitted sender) client-ip=2a00:1450:4010:c03::22e; Received: by mail-la0-f46.google.com with SMTP id q1so3180719lam.5 for ; Tue, 13 Jan 2015 07:20:39 -0800 (PST) X-Received: by 10.112.170.36 with SMTP id aj4mr42569912lbc.3.1421162439902; Tue, 13 Jan 2015 07:20:39 -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 c8csp1413828lbb; Tue, 13 Jan 2015 07:20:38 -0800 (PST) X-Received: by 10.70.140.130 with SMTP id rg2mr52475025pdb.49.1421162437954; Tue, 13 Jan 2015 07:20:37 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id hr1si27470026pbb.18.2015.01.13.07.20.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jan 2015 07:20:37 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-389031-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 22657 invoked by alias); 13 Jan 2015 15:19:03 -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 22436 invoked by uid 89); 13 Jan 2015 15:18:59 -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-we0-f172.google.com Received: from mail-we0-f172.google.com (HELO mail-we0-f172.google.com) (74.125.82.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 13 Jan 2015 15:18:54 +0000 Received: by mail-we0-f172.google.com with SMTP id k11so3504121wes.3 for ; Tue, 13 Jan 2015 07:18:51 -0800 (PST) X-Received: by 10.181.27.199 with SMTP id ji7mr41607158wid.76.1421162331076; Tue, 13 Jan 2015 07:18:51 -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.18.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jan 2015 07:18:50 -0800 (PST) From: Christophe Lyon To: gcc-patches@gcc.gnu.org Subject: [[ARM/AArch64][testsuite] 04/36] Add vld1_lane tests. Date: Tue, 13 Jan 2015 16:18:02 +0100 Message-Id: <1421162314-25779-5-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:c03::22e 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/vld1_lane.c: New file. diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vld1_lane.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vld1_lane.c new file mode 100644 index 0000000..168cf5e --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vld1_lane.c @@ -0,0 +1,129 @@ +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL(expected,int,8,8) [] = { 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xf0, 0xaa }; +VECT_VAR_DECL(expected,int,16,4) [] = { 0xaaaa, 0xaaaa, 0xaaaa, 0xfff0 }; +VECT_VAR_DECL(expected,int,32,2) [] = { 0xaaaaaaaa, 0xfffffff0 }; +VECT_VAR_DECL(expected,int,64,1) [] = { 0xfffffffffffffff0 }; +VECT_VAR_DECL(expected,uint,8,8) [] = { 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xf0 }; +VECT_VAR_DECL(expected,uint,16,4) [] = { 0xaaaa, 0xaaaa, 0xaaaa, 0xfff0 }; +VECT_VAR_DECL(expected,uint,32,2) [] = { 0xaaaaaaaa, 0xfffffff0 }; +VECT_VAR_DECL(expected,uint,64,1) [] = { 0xfffffffffffffff0 }; +VECT_VAR_DECL(expected,poly,8,8) [] = { 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xf0 }; +VECT_VAR_DECL(expected,poly,16,4) [] = { 0xaaaa, 0xaaaa, 0xaaaa, 0xfff0 }; +VECT_VAR_DECL(expected,hfloat,32,2) [] = { 0xaaaaaaaa, 0xc1800000 }; +VECT_VAR_DECL(expected,int,8,16) [] = { 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xf0 }; +VECT_VAR_DECL(expected,int,16,8) [] = { 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa, + 0xaaaa, 0xfff0, 0xaaaa, 0xaaaa }; +VECT_VAR_DECL(expected,int,32,4) [] = { 0xaaaaaaaa, 0xaaaaaaaa, + 0xfffffff0, 0xaaaaaaaa }; +VECT_VAR_DECL(expected,int,64,2) [] = { 0xaaaaaaaaaaaaaaaa, + 0xfffffffffffffff0 }; +VECT_VAR_DECL(expected,uint,8,16) [] = { 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, + 0xf0, 0xaa, 0xaa, 0xaa }; +VECT_VAR_DECL(expected,uint,16,8) [] = { 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa, + 0xaaaa, 0xaaaa, 0xfff0, 0xaaaa }; +VECT_VAR_DECL(expected,uint,32,4) [] = { 0xaaaaaaaa, 0xaaaaaaaa, + 0xfffffff0, 0xaaaaaaaa }; +VECT_VAR_DECL(expected,uint,64,2) [] = { 0xfffffffffffffff0, + 0xaaaaaaaaaaaaaaaa }; +VECT_VAR_DECL(expected,poly,8,16) [] = { 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, + 0xf0, 0xaa, 0xaa, 0xaa }; +VECT_VAR_DECL(expected,poly,16,8) [] = { 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa, + 0xaaaa, 0xaaaa, 0xfff0, 0xaaaa }; +VECT_VAR_DECL(expected,hfloat,32,4) [] = { 0xaaaaaaaa, 0xaaaaaaaa, + 0xc1800000, 0xaaaaaaaa }; + +#define TEST_MSG "VLD1_LANE/VLD1_LANEQ" +void exec_vld1_lane (void) +{ + /* Fill vector_src with 0xAA, then load 1 lane. */ +#define TEST_VLD1_LANE(Q, T1, T2, W, N, L) \ + memset (VECT_VAR(buffer_src, T1, W, N), 0xAA, W/8*N); \ + VECT_VAR(vector_src, T1, W, N) = \ + vld1##Q##_##T2##W(VECT_VAR(buffer_src, T1, W, N)); \ + VECT_VAR(vector, T1, W, N) = \ + vld1##Q##_lane_##T2##W(VECT_VAR(buffer, T1, W, N), \ + VECT_VAR(vector_src, T1, W, N), L); \ + vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), VECT_VAR(vector, T1, W, N)) + + DECL_VARIABLE_ALL_VARIANTS(vector); + DECL_VARIABLE_ALL_VARIANTS(vector_src); + + ARRAY(buffer_src, int, 8, 8); + ARRAY(buffer_src, int, 16, 4); + ARRAY(buffer_src, int, 32, 2); + ARRAY(buffer_src, int, 64, 1); + ARRAY(buffer_src, uint, 8, 8); + ARRAY(buffer_src, uint, 16, 4); + ARRAY(buffer_src, uint, 32, 2); + ARRAY(buffer_src, uint, 64, 1); + ARRAY(buffer_src, poly, 8, 8); + ARRAY(buffer_src, poly, 16, 4); + ARRAY(buffer_src, float, 32, 2); + + ARRAY(buffer_src, int, 8, 16); + ARRAY(buffer_src, int, 16, 8); + ARRAY(buffer_src, int, 32, 4); + ARRAY(buffer_src, int, 64, 2); + ARRAY(buffer_src, uint, 8, 16); + ARRAY(buffer_src, uint, 16, 8); + ARRAY(buffer_src, uint, 32, 4); + ARRAY(buffer_src, uint, 64, 2); + ARRAY(buffer_src, poly, 8, 16); + ARRAY(buffer_src, poly, 16, 8); + ARRAY(buffer_src, float, 32, 4); + + clean_results (); + + /* Choose lane arbitrarily. */ + TEST_VLD1_LANE(, int, s, 8, 8, 6); + TEST_VLD1_LANE(, int, s, 16, 4, 3); + TEST_VLD1_LANE(, int, s, 32, 2, 1); + TEST_VLD1_LANE(, int, s, 64, 1, 0); + TEST_VLD1_LANE(, uint, u, 8, 8, 7); + TEST_VLD1_LANE(, uint, u, 16, 4, 3); + TEST_VLD1_LANE(, uint, u, 32, 2, 1); + TEST_VLD1_LANE(, uint, u, 64, 1, 0); + TEST_VLD1_LANE(, poly, p, 8, 8, 7); + TEST_VLD1_LANE(, poly, p, 16, 4, 3); + TEST_VLD1_LANE(, float, f, 32, 2, 1); + + TEST_VLD1_LANE(q, int, s, 8, 16, 15); + TEST_VLD1_LANE(q, int, s, 16, 8, 5); + TEST_VLD1_LANE(q, int, s, 32, 4, 2); + TEST_VLD1_LANE(q, int, s, 64, 2, 1); + TEST_VLD1_LANE(q, uint, u, 8, 16, 12); + TEST_VLD1_LANE(q, uint, u, 16, 8, 6); + TEST_VLD1_LANE(q, uint, u, 32, 4, 2); + TEST_VLD1_LANE(q, uint, u, 64, 2, 0); + TEST_VLD1_LANE(q, poly, p, 8, 16, 12); + TEST_VLD1_LANE(q, poly, p, 16, 8, 6); + TEST_VLD1_LANE(q, float, f, 32, 4, 2); + +#ifndef __CC_ARM + /* Check runtime assertions. With RVCT, the check is performed at + compile-time */ + // TEST_VLD1_LANE(, int, s, 64, 1, 1); +#endif + + CHECK_RESULTS (TEST_MSG, ""); +} + +int main (void) +{ + exec_vld1_lane (); + return 0; +}