From patchwork Wed May 27 20:15:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 49026 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A27D202A3 for ; Wed, 27 May 2015 20:16:50 +0000 (UTC) Received: by wizk4 with SMTP id k4sf8153870wiz.2 for ; Wed, 27 May 2015 13:16:49 -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=Z2wohYp6m1TxkM8v6P4xRONRMOkvXkyiUyDIQyY6RYY=; b=AQzau3ci2tQqPxSs7E/JF5huwSLDAGaXonFvAHwJwOUG93ht/2Fu1DJ6Akwwegr99S 0hqcg4dszDaKScFXV4JoCr/fe/wCErQXQyHKhL5sa+IMQcI3Zrs1m/0M/zN7ZByr8JLk MMAgLwJRL0cJDDAEyBbf/yUcD9gXjNTKA6paWUjNvlfRg+A9Zw1Y+3mo76il0dcCCzlF k/mHci1WYjuWMptjJuFtV8y8KyK/J32lPFZaAJTCl3kY4Ty0ieWRoQfKf2lUX2jOx5sW MxF1j0bYt0bHeGFanI61GEe18hVEhXAlqtMcB0QQA5EsCyO8YvWHrPxEe4EIR6nd+eyq 5kkA== X-Gm-Message-State: ALoCoQmCwGNayhI1xC8RpfbW+8vpheNhDs+QDSfFVroCE3x4W6/10hNbYaHxJZZRx55ciKZ53u7Y X-Received: by 10.152.37.101 with SMTP id x5mr33712787laj.5.1432757809348; Wed, 27 May 2015 13:16:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.103 with SMTP id kx7ls103821lac.62.gmail; Wed, 27 May 2015 13:16:49 -0700 (PDT) X-Received: by 10.152.6.105 with SMTP id z9mr28923858laz.98.1432757809194; Wed, 27 May 2015 13:16:49 -0700 (PDT) Received: from mail-la0-x22c.google.com (mail-la0-x22c.google.com. [2a00:1450:4010:c03::22c]) by mx.google.com with ESMTPS id ld16si6346lbb.169.2015.05.27.13.16.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 May 2015 13:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22c as permitted sender) client-ip=2a00:1450:4010:c03::22c; Received: by lagv1 with SMTP id v1so16080919lag.3 for ; Wed, 27 May 2015 13:16:48 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr30362397lbc.32.1432757808703; Wed, 27 May 2015 13:16:48 -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 hn6csp626415lbb; Wed, 27 May 2015 13:16:47 -0700 (PDT) X-Received: by 10.66.234.134 with SMTP id ue6mr61105445pac.146.1432757806916; Wed, 27 May 2015 13:16:46 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id kg7si90330pab.12.2015.05.27.13.16.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 May 2015 13:16:46 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-399109-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 36886 invoked by alias); 27 May 2015 20:16:08 -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 36789 invoked by uid 89); 27 May 2015 20:16:07 -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-f170.google.com Received: from mail-wi0-f170.google.com (HELO mail-wi0-f170.google.com) (209.85.212.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 27 May 2015 20:16:02 +0000 Received: by wizo1 with SMTP id o1so36450589wiz.1 for ; Wed, 27 May 2015 13:15:59 -0700 (PDT) X-Received: by 10.180.210.162 with SMTP id mv2mr9316869wic.59.1432757759578; Wed, 27 May 2015 13:15:59 -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.15.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 May 2015 13:15:59 -0700 (PDT) From: Christophe Lyon To: gcc-patches@gcc.gnu.org Subject: [Patch ARM-AArch64/testsuite Neon intrinsics 06/20] Add vshr_n tests. Date: Wed, 27 May 2015 22:15:33 +0200 Message-Id: <1432757747-4891-7-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:c03::22c 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/vshr_n.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vshr_n.c new file mode 100644 index 0000000..122ce41 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vshr_n.c @@ -0,0 +1,95 @@ +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected results. */ +VECT_VAR_DECL(expected,int,8,8) [] = { 0xf8, 0xf8, 0xf9, 0xf9, + 0xfa, 0xfa, 0xfb, 0xfb }; +VECT_VAR_DECL(expected,int,16,4) [] = { 0xffff, 0xffff, 0xffff, 0xffff }; +VECT_VAR_DECL(expected,int,32,2) [] = { 0xfffffffc, 0xfffffffc }; +VECT_VAR_DECL(expected,int,64,1) [] = { 0xffffffffffffffff }; +VECT_VAR_DECL(expected,uint,8,8) [] = { 0x3c, 0x3c, 0x3c, 0x3c, + 0x3d, 0x3d, 0x3d, 0x3d }; +VECT_VAR_DECL(expected,uint,16,4) [] = { 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe }; +VECT_VAR_DECL(expected,uint,32,2) [] = { 0x7ffffff, 0x7ffffff }; +VECT_VAR_DECL(expected,uint,64,1) [] = { 0x7fffffff }; +VECT_VAR_DECL(expected,int,8,16) [] = { 0xf8, 0xf8, 0xf9, 0xf9, + 0xfa, 0xfa, 0xfb, 0xfb, + 0xfc, 0xfc, 0xfd, 0xfd, + 0xfe, 0xfe, 0xff, 0xff }; +VECT_VAR_DECL(expected,int,16,8) [] = { 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff }; +VECT_VAR_DECL(expected,int,32,4) [] = { 0xfffffffc, 0xfffffffc, + 0xfffffffc, 0xfffffffc }; +VECT_VAR_DECL(expected,int,64,2) [] = { 0xffffffffffffffff, 0xffffffffffffffff }; +VECT_VAR_DECL(expected,uint,8,16) [] = { 0x3c, 0x3c, 0x3c, 0x3c, + 0x3d, 0x3d, 0x3d, 0x3d, + 0x3e, 0x3e, 0x3e, 0x3e, + 0x3f, 0x3f, 0x3f, 0x3f }; +VECT_VAR_DECL(expected,uint,16,8) [] = { 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, + 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe }; +VECT_VAR_DECL(expected,uint,32,4) [] = { 0x7ffffff, 0x7ffffff, + 0x7ffffff, 0x7ffffff }; +VECT_VAR_DECL(expected,uint,64,2) [] = { 0x7fffffff, 0x7fffffff }; + +#define TEST_MSG "VSHR_N" +void exec_vshr_n (void) +{ + /* Basic test: y=vshr_n(x,v), then store the result. */ +#define TEST_VSHR_N(Q, T1, T2, W, N, V) \ + VECT_VAR(vector_res, T1, W, N) = \ + vshr##Q##_n_##T2##W(VECT_VAR(vector, T1, W, N), \ + V); \ + vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), VECT_VAR(vector_res, T1, W, N)) + + DECL_VARIABLE_ALL_VARIANTS(vector); + DECL_VARIABLE_ALL_VARIANTS(vector_res); + + clean_results (); + + /* Initialize input "vector" from "buffer". */ + TEST_MACRO_ALL_VARIANTS_2_5(VLOAD, vector, buffer); + + /* Choose shift amount arbitrarily. */ + TEST_VSHR_N(, int, s, 8, 8, 1); + TEST_VSHR_N(, int, s, 16, 4, 12); + TEST_VSHR_N(, int, s, 32, 2, 2); + TEST_VSHR_N(, int, s, 64, 1, 32); + TEST_VSHR_N(, uint, u, 8, 8, 2); + TEST_VSHR_N(, uint, u, 16, 4, 3); + TEST_VSHR_N(, uint, u, 32, 2, 5); + TEST_VSHR_N(, uint, u, 64, 1, 33); + + TEST_VSHR_N(q, int, s, 8, 16, 1); + TEST_VSHR_N(q, int, s, 16, 8, 12); + TEST_VSHR_N(q, int, s, 32, 4, 2); + TEST_VSHR_N(q, int, s, 64, 2, 32); + TEST_VSHR_N(q, uint, u, 8, 16, 2); + TEST_VSHR_N(q, uint, u, 16, 8, 3); + TEST_VSHR_N(q, uint, u, 32, 4, 5); + TEST_VSHR_N(q, uint, u, 64, 2, 33); + +#define CMT "" + CHECK(TEST_MSG, int, 8, 8, PRIx8, expected, CMT); + CHECK(TEST_MSG, int, 16, 4, PRIx16, expected, CMT); + CHECK(TEST_MSG, int, 32, 2, PRIx32, expected, CMT); + CHECK(TEST_MSG, int, 64, 1, PRIx64, expected, CMT); + CHECK(TEST_MSG, uint, 8, 8, PRIx8, expected, CMT); + CHECK(TEST_MSG, uint, 16, 4, PRIx16, expected, CMT); + CHECK(TEST_MSG, uint, 32, 2, PRIx32, expected, CMT); + CHECK(TEST_MSG, uint, 64, 1, PRIx64, expected, CMT); + CHECK(TEST_MSG, int, 8, 16, PRIx8, expected, CMT); + CHECK(TEST_MSG, int, 16, 8, PRIx16, expected, CMT); + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, CMT); + CHECK(TEST_MSG, int, 64, 2, PRIx64, expected, CMT); + CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected, CMT); + CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected, CMT); + CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, CMT); + CHECK(TEST_MSG, uint, 64, 2, PRIx64, expected, CMT); +} + +int main (void) +{ + exec_vshr_n (); + return 0; +}