From patchwork Tue May 12 20:30:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 48403 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 99D222121F for ; Tue, 12 May 2015 20:32:10 +0000 (UTC) Received: by labgx2 with SMTP id gx2sf4761554lab.1 for ; Tue, 12 May 2015 13:32:09 -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=OA8buc5+w14wMuXHDTgU5heF3/oycrr00K91pNT9A8c=; b=Vc3I8WMglv9M+EjGkr4qTR1q+v7Z/kgf/Lk619XhKVPWmDQiSJ3V+VVAgusiXlhxem 0sK5UaIqh53lPHQploKhpOMNIEYwWfiL7plNwmBQ68PHmwcs7KVLxHTLilh0lNybvJpA /CYq13uSvkTkHQo5fIa2VJ0zMDW1yktZJF7f/Z+GaGZwCOzpnzrEWqU7KvaC/gErrbT9 oFuFvNKUrbSQo+y+Ok5LUNnEc3hL6YWgGZOFh5FumVHuqnH3QvgHc8pitVbVSgUwa7av EuDK6YJUIs87dFmJWZ6R8BRTg1bz0U4G1vcTBAPjnT/Qyw0LlpvqRHh0oen4TGp4Ku8a XhVA== X-Gm-Message-State: ALoCoQn8FRvTl95A/5n6+7bVqtcQXD91crO/dS+mTt23XqWaEQ2qRmbTyZ/adfByqaNiz/MrmXPg X-Received: by 10.112.55.104 with SMTP id r8mr11721198lbp.18.1431462729192; Tue, 12 May 2015 13:32:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.43 with SMTP id ll11ls92618lac.12.gmail; Tue, 12 May 2015 13:32:08 -0700 (PDT) X-Received: by 10.112.161.226 with SMTP id xv2mr13499490lbb.106.1431462728905; Tue, 12 May 2015 13:32:08 -0700 (PDT) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com. [2a00:1450:4010:c03::231]) by mx.google.com with ESMTPS id e10si11024178lae.15.2015.05.12.13.32.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 13:32:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::231 as permitted sender) client-ip=2a00:1450:4010:c03::231; Received: by labbd9 with SMTP id bd9so14846593lab.2 for ; Tue, 12 May 2015 13:32:08 -0700 (PDT) X-Received: by 10.152.2.227 with SMTP id 3mr4203155lax.73.1431462728431; Tue, 12 May 2015 13:32:08 -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 hn6csp136569lbb; Tue, 12 May 2015 13:32:07 -0700 (PDT) X-Received: by 10.66.234.134 with SMTP id ue6mr31040313pac.146.1431462726708; Tue, 12 May 2015 13:32:06 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g6si24002049pat.48.2015.05.12.13.32.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 13:32:06 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-397711-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 75596 invoked by alias); 12 May 2015 20:31:20 -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 75386 invoked by uid 89); 12 May 2015 20:31:15 -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-f176.google.com Received: from mail-wi0-f176.google.com (HELO mail-wi0-f176.google.com) (209.85.212.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 12 May 2015 20:31:14 +0000 Received: by wizk4 with SMTP id k4so170397472wiz.1 for ; Tue, 12 May 2015 13:31:11 -0700 (PDT) X-Received: by 10.194.2.47 with SMTP id 15mr33747978wjr.101.1431462671301; Tue, 12 May 2015 13:31:11 -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 u9sm24921095wju.44.2015.05.12.13.31.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 May 2015 13:31:10 -0700 (PDT) From: Christophe Lyon To: gcc-patches@gcc.gnu.org Subject: [Patch ARM-AArch64/testsuite Neon intrinsics 02/13] Add vqmovun tests. Date: Tue, 12 May 2015 22:30:50 +0200 Message-Id: <1431462661-27247-3-git-send-email-christophe.lyon@linaro.org> In-Reply-To: <1431462661-27247-1-git-send-email-christophe.lyon@linaro.org> References: <1431462661-27247-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::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 diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqmovun.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqmovun.c new file mode 100644 index 0000000..d744765 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqmovun.c @@ -0,0 +1,93 @@ +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected values of cumulative_saturation flag. */ +int VECT_VAR(expected_cumulative_sat,uint,8,8) = 0; +int VECT_VAR(expected_cumulative_sat,uint,16,4) = 0; +int VECT_VAR(expected_cumulative_sat,uint,32,2) = 0; + +/* Expected results. */ +VECT_VAR_DECL(expected,uint,8,8) [] = { 0x34, 0x34, 0x34, 0x34, + 0x34, 0x34, 0x34, 0x34 }; +VECT_VAR_DECL(expected,uint,16,4) [] = { 0x5678, 0x5678, 0x5678, 0x5678 }; +VECT_VAR_DECL(expected,uint,32,2) [] = { 0x12345678, 0x12345678 }; + +/* Expected values of cumulative_saturation flag with negative input. */ +int VECT_VAR(expected_cumulative_sat_neg,uint,8,8) = 1; +int VECT_VAR(expected_cumulative_sat_neg,uint,16,4) = 1; +int VECT_VAR(expected_cumulative_sat_neg,uint,32,2) = 1; + +/* Expected results with negative input. */ +VECT_VAR_DECL(expected_neg,uint,8,8) [] = { 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0 }; +VECT_VAR_DECL(expected_neg,uint,16,4) [] = { 0x0, 0x0, 0x0, 0x0 }; +VECT_VAR_DECL(expected_neg,uint,32,2) [] = { 0x0, 0x0 }; + +#define INSN_NAME vqmovun +#define TEST_MSG "VQMOVUN" + +#define FNNAME1(NAME) void exec_ ## NAME (void) +#define FNNAME(NAME) FNNAME1(NAME) + +FNNAME (INSN_NAME) +{ + /* Basic test: y=OP(x), then store the result. */ +#define TEST_UNARY_OP1(INSN, T1, T2, W, W2, N, EXPECTED_CUMULATIVE_SAT, CMT) \ + Set_Neon_Cumulative_Sat(0, VECT_VAR(vector_res, T1, W, N)); \ + VECT_VAR(vector_res, T1, W, N) = \ + INSN##_s##W2(VECT_VAR(vector, int, W2, N)); \ + vst1##_##T2##W(VECT_VAR(result, T1, W, N), \ + VECT_VAR(vector_res, T1, W, N)); \ + CHECK_CUMULATIVE_SAT(TEST_MSG, T1, W, N, EXPECTED_CUMULATIVE_SAT, CMT) + +#define TEST_UNARY_OP(INSN, T1, T2, W, W2, N, EXPECTED_CUMULATIVE_SAT, CMT) \ + TEST_UNARY_OP1(INSN, T1, T2, W, W2, N, EXPECTED_CUMULATIVE_SAT, CMT) + + DECL_VARIABLE(vector, int, 16, 8); + DECL_VARIABLE(vector, int, 32, 4); + DECL_VARIABLE(vector, int, 64, 2); + + DECL_VARIABLE(vector_res, uint, 8, 8); + DECL_VARIABLE(vector_res, uint, 16, 4); + DECL_VARIABLE(vector_res, uint, 32, 2); + + clean_results (); + + /* Fill input vector with arbitrary values. */ + VDUP(vector, q, int, s, 16, 8, 0x34); + VDUP(vector, q, int, s, 32, 4, 0x5678); + VDUP(vector, q, int, s, 64, 2, 0x12345678); + + /* Apply a unary operator named INSN_NAME. */ +#define CMT "" + TEST_UNARY_OP(INSN_NAME, uint, u, 8, 16, 8, expected_cumulative_sat, CMT); + TEST_UNARY_OP(INSN_NAME, uint, u, 16, 32, 4, expected_cumulative_sat, CMT); + TEST_UNARY_OP(INSN_NAME, uint, u, 32, 64, 2, expected_cumulative_sat, 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); + + /* Fill input vector with negative values. */ + VDUP(vector, q, int, s, 16, 8, 0x8234); + VDUP(vector, q, int, s, 32, 4, 0x87654321); + VDUP(vector, q, int, s, 64, 2, 0x8765432187654321LL); + + /* Apply a unary operator named INSN_NAME. */ +#undef CMT +#define CMT " (negative input)" + TEST_UNARY_OP(INSN_NAME, uint, u, 8, 16, 8, expected_cumulative_sat_neg, CMT); + TEST_UNARY_OP(INSN_NAME, uint, u, 16, 32, 4, expected_cumulative_sat_neg, CMT); + TEST_UNARY_OP(INSN_NAME, uint, u, 32, 64, 2, expected_cumulative_sat_neg, CMT); + + CHECK(TEST_MSG, uint, 8, 8, PRIx8, expected_neg, CMT); + CHECK(TEST_MSG, uint, 16, 4, PRIx16, expected_neg, CMT); + CHECK(TEST_MSG, uint, 32, 2, PRIx32, expected_neg, CMT); +} + +int main (void) +{ + exec_vqmovun (); + return 0; +}