From patchwork Wed May 27 20:15:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 49029 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E0055202A3 for ; Wed, 27 May 2015 20:17:28 +0000 (UTC) Received: by lbbti3 with SMTP id ti3sf5450556lbb.1 for ; Wed, 27 May 2015 13:17:27 -0700 (PDT) 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=FsR7Byv6zBaXw2QCwfMaiClLCSTl9qbA9n+Ybs/YUkA=; b=h0YeivGBhihRIvoesPz/3zvv/DQF2ZC3zn3OFTdf+xFUEHOVwIVY8eUUdufEorQHQh tabUDBUApFMjztkIZILw0bHWVVUP3WaZ/RqJZKlkyhBjqsTFiUPrWlZf28Nq4ID7gsrE PDQklWBqtX0ToXSBkCwVf26zKt0gTjXboRGhm/b+zOVNB+rnNnXv67lfsssvrHlw7mfw wN6sQcd7HIxl4cdA3uhRx7ssa8WYP/3lD2UKiOanRZZqtBR55QG3eLOUKgH/RgkNulL0 ChJPba9os52RjnqSJD3fuduRq4Pfof6oP1ExuG++j9MRNec8+KPp+OkeyDnkVT4fnrHY jaKA== X-Gm-Message-State: ALoCoQkLGrveSfP8xj7UjC/EfeV6ScZAbmSsoJN5XSdSFQ2fknFK6MLHD5KOjSo34cg9YBKqq2CY X-Received: by 10.180.105.226 with SMTP id gp2mr29718837wib.1.1432757847810; Wed, 27 May 2015 13:17:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.211 with SMTP id jq19ls107315lab.69.gmail; Wed, 27 May 2015 13:17:27 -0700 (PDT) X-Received: by 10.112.55.70 with SMTP id q6mr10503349lbp.99.1432757847643; Wed, 27 May 2015 13:17:27 -0700 (PDT) Received: from mail-lb0-x236.google.com (mail-lb0-x236.google.com. [2a00:1450:4010:c04::236]) by mx.google.com with ESMTPS id mh3si38561lbb.59.2015.05.27.13.17.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 May 2015 13:17:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::236 as permitted sender) client-ip=2a00:1450:4010:c04::236; Received: by lbbuc2 with SMTP id uc2so15101132lbb.2 for ; Wed, 27 May 2015 13:17:26 -0700 (PDT) X-Received: by 10.152.29.161 with SMTP id l1mr29414535lah.76.1432757846700; Wed, 27 May 2015 13:17:26 -0700 (PDT) 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.108.230 with SMTP id hn6csp626776lbb; Wed, 27 May 2015 13:17:25 -0700 (PDT) X-Received: by 10.70.44.199 with SMTP id g7mr61531454pdm.27.1432757844828; Wed, 27 May 2015 13:17:24 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id rc3si34106pbc.149.2015.05.27.13.17.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 May 2015 13:17:24 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-399112-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 37486 invoked by alias); 27 May 2015 20:16:13 -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 37362 invoked by uid 89); 27 May 2015 20:16:12 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, 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-GCM-SHA256 encrypted) ESMTPS; Wed, 27 May 2015 20:16:08 +0000 Received: by wicmx19 with SMTP id mx19so104551144wic.0 for ; Wed, 27 May 2015 13:16:05 -0700 (PDT) X-Received: by 10.194.60.164 with SMTP id i4mr62718783wjr.133.1432757765244; Wed, 27 May 2015 13:16:05 -0700 (PDT) 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 u7sm76992wif.3.2015.05.27.13.16.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 May 2015 13:16:04 -0700 (PDT) From: Christophe Lyon To: gcc-patches@gcc.gnu.org Subject: [Patch ARM-AArch64/testsuite Neon intrinsics 12/20] Add vset_lane tests. Date: Wed, 27 May 2015 22:15:39 +0200 Message-Id: <1432757747-4891-13-git-send-email-christophe.lyon@linaro.org> In-Reply-To: <1432757747-4891-1-git-send-email-christophe.lyon@linaro.org> References: <1432757747-4891-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::236 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 diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vset_lane.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vset_lane.c new file mode 100644 index 0000000..5159406 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vset_lane.c @@ -0,0 +1,99 @@ +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL(expected,int,8,8) [] = { 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0xf6, 0x11 }; +VECT_VAR_DECL(expected,int,16,4) [] = { 0xfff0, 0xfff1, 0xfff2, 0x22 }; +VECT_VAR_DECL(expected,int,32,2) [] = { 0xfffffff0, 0x33 }; +VECT_VAR_DECL(expected,int,64,1) [] = { 0x44 }; +VECT_VAR_DECL(expected,uint,8,8) [] = { 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0x55, 0xf7 }; +VECT_VAR_DECL(expected,uint,16,4) [] = { 0xfff0, 0xfff1, 0x66, 0xfff3 }; +VECT_VAR_DECL(expected,uint,32,2) [] = { 0xfffffff0, 0x77 }; +VECT_VAR_DECL(expected,uint,64,1) [] = { 0x88 }; +VECT_VAR_DECL(expected,poly,8,8) [] = { 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0x55, 0xf7 }; +VECT_VAR_DECL(expected,poly,16,4) [] = { 0xfff0, 0xfff1, 0x66, 0xfff3 }; +VECT_VAR_DECL(expected,hfloat,32,2) [] = { 0xc1800000, 0x4204cccd }; +VECT_VAR_DECL(expected,int,8,16) [] = { 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, + 0xfc, 0xfd, 0xfe, 0x99 }; +VECT_VAR_DECL(expected,int,16,8) [] = { 0xfff0, 0xfff1, 0xfff2, 0xfff3, + 0xfff4, 0xaa, 0xfff6, 0xfff7 }; +VECT_VAR_DECL(expected,int,32,4) [] = { 0xfffffff0, 0xfffffff1, + 0xfffffff2, 0xbb }; +VECT_VAR_DECL(expected,int,64,2) [] = { 0xfffffffffffffff0, 0xcc }; +VECT_VAR_DECL(expected,uint,8,16) [] = { 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, + 0xfc, 0xfd, 0xdd, 0xff }; +VECT_VAR_DECL(expected,uint,16,8) [] = { 0xfff0, 0xfff1, 0xfff2, 0xfff3, + 0xfff4, 0xfff5, 0xee, 0xfff7 }; +VECT_VAR_DECL(expected,uint,32,4) [] = { 0xfffffff0, 0xfffffff1, + 0xff, 0xfffffff3 }; +VECT_VAR_DECL(expected,uint,64,2) [] = { 0xfffffffffffffff0, 0x11 }; +VECT_VAR_DECL(expected,poly,8,16) [] = { 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, + 0xfc, 0xfd, 0xdd, 0xff }; +VECT_VAR_DECL(expected,poly,16,8) [] = { 0xfff0, 0xfff1, 0xfff2, 0xfff3, + 0xfff4, 0xfff5, 0xee, 0xfff7 }; +VECT_VAR_DECL(expected,hfloat,32,4) [] = { 0xc1800000, 0xc1700000, + 0xc1600000, 0x41333333 }; + +#define TEST_MSG "VSET_LANE/VSET_LANEQ" +void exec_vset_lane (void) +{ + /* vec=vset_lane(val, vec, lane), then store the result. */ +#define TEST_VSET_LANE(Q, T1, T2, W, N, V, L) \ + VECT_VAR(vector, T1, W, N) = \ + vset##Q##_lane_##T2##W(V, \ + VECT_VAR(vector, 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); + + clean_results (); + + /* Initialize input "vector" from "buffer". */ + TEST_MACRO_ALL_VARIANTS_2_5(VLOAD, vector, buffer); + VLOAD(vector, buffer, , float, f, 32, 2); + VLOAD(vector, buffer, q, float, f, 32, 4); + + /* Choose value and lane arbitrarily. */ + TEST_VSET_LANE(, int, s, 8, 8, 0x11, 7); + TEST_VSET_LANE(, int, s, 16, 4, 0x22, 3); + TEST_VSET_LANE(, int, s, 32, 2, 0x33, 1); + TEST_VSET_LANE(, int, s, 64, 1, 0x44, 0); + TEST_VSET_LANE(, uint, u, 8, 8, 0x55, 6); + TEST_VSET_LANE(, uint, u, 16, 4, 0x66, 2); + TEST_VSET_LANE(, uint, u, 32, 2, 0x77, 1); + TEST_VSET_LANE(, uint, u, 64, 1, 0x88, 0); + TEST_VSET_LANE(, poly, p, 8, 8, 0x55, 6); + TEST_VSET_LANE(, poly, p, 16, 4, 0x66, 2); + TEST_VSET_LANE(, float, f, 32, 2, 33.2f, 1); + + TEST_VSET_LANE(q, int, s, 8, 16, 0x99, 15); + TEST_VSET_LANE(q, int, s, 16, 8, 0xAA, 5); + TEST_VSET_LANE(q, int, s, 32, 4, 0xBB, 3); + TEST_VSET_LANE(q, int, s, 64, 2, 0xCC, 1); + TEST_VSET_LANE(q, uint, u, 8, 16, 0xDD, 14); + TEST_VSET_LANE(q, uint, u, 16, 8, 0xEE, 6); + TEST_VSET_LANE(q, uint, u, 32, 4, 0xFF, 2); + TEST_VSET_LANE(q, uint, u, 64, 2, 0x11, 1); + TEST_VSET_LANE(q, poly, p, 8, 16, 0xDD, 14); + TEST_VSET_LANE(q, poly, p, 16, 8, 0xEE, 6); + TEST_VSET_LANE(q, float, f, 32, 4, 11.2f, 3); + + CHECK_RESULTS(TEST_MSG, ""); +} + +int main (void) +{ + exec_vset_lane (); + return 0; +}