From patchwork Tue Jan 13 15:18:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 43052 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 187C620DE8 for ; Tue, 13 Jan 2015 15:28:56 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id ex7sf2287375wid.3 for ; Tue, 13 Jan 2015 07:28:55 -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=G4hALFjWutZSyyvK0RnwUa2KNv8DCvh7U4pnxsXijLM=; b=Ch6Y9sp7IbqbaciO2Vh07Wg9lcT6Hu88KX0OgFaWg44C9vtewPC6ih6ecFpfxcktUp YYMgJ5I9Sc+CUmm46XsSIz8tfNpdG48qRaTvmyNbElrXscyPgscgXl+2NvargzGLoYCO 1VlIErb6Fq6ay9W1sMpWr6Su5BN/Bw+Z6WTG+HtoLxJDeHK4j1pYBYqv1za2s+Je/WdG aA73CCPfFhroO4Cr8tm/g9cgU00L4KajZZKAcBF/tShd7eQ6xy9L8psUCylZ44hMJyQx S0f34Zuwj59Rz62gsdmaEwgVbcwmgcI8ZIo6B3Ojsv6QBniQHFyxk8bGi18vO/+22jJl r8Dw== X-Gm-Message-State: ALoCoQk0FVo7+gHa58FVL9gqYKDGUYz3j2vYl4JSMqaYOcV3rmxIfooe82cLkrgcWSTCAg/V9xYo X-Received: by 10.112.171.74 with SMTP id as10mr1589155lbc.8.1421162935343; Tue, 13 Jan 2015 07:28:55 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.130 with SMTP id b2ls8541laa.27.gmail; Tue, 13 Jan 2015 07:28:55 -0800 (PST) X-Received: by 10.152.5.226 with SMTP id v2mr43070085lav.34.1421162935203; Tue, 13 Jan 2015 07:28:55 -0800 (PST) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com. [2a00:1450:4010:c04::22e]) by mx.google.com with ESMTPS id zd4si24542196lbb.75.2015.01.13.07.28.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 07:28:55 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22e as permitted sender) client-ip=2a00:1450:4010:c04::22e; Received: by mail-lb0-f174.google.com with SMTP id 10so3143715lbg.5 for ; Tue, 13 Jan 2015 07:28:55 -0800 (PST) X-Received: by 10.152.115.146 with SMTP id jo18mr43433597lab.9.1421162935040; Tue, 13 Jan 2015 07:28:55 -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 c8csp1416154lbb; Tue, 13 Jan 2015 07:28:54 -0800 (PST) X-Received: by 10.70.129.48 with SMTP id nt16mr51217943pdb.113.1421162933200; Tue, 13 Jan 2015 07:28:53 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id oi10si11619700pab.163.2015.01.13.07.28.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jan 2015 07:28:53 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-389061-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 26620 invoked by alias); 13 Jan 2015 15:19:51 -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 25358 invoked by uid 89); 13 Jan 2015 15:19:35 -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-wg0-f54.google.com Received: from mail-wg0-f54.google.com (HELO mail-wg0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 13 Jan 2015 15:19:32 +0000 Received: by mail-wg0-f54.google.com with SMTP id z12so3536301wgg.13 for ; Tue, 13 Jan 2015 07:19:29 -0800 (PST) X-Received: by 10.180.11.140 with SMTP id q12mr41389842wib.45.1421162369586; Tue, 13 Jan 2015 07:19:29 -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.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jan 2015 07:19:28 -0800 (PST) From: Christophe Lyon To: gcc-patches@gcc.gnu.org Subject: [[ARM/AArch64][testsuite] 34/36] Add vqdmull tests. Date: Tue, 13 Jan 2015 16:18:32 +0100 Message-Id: <1421162314-25779-35-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:c04::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/vqdmull.c: New file. diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmull.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmull.c new file mode 100644 index 0000000..e71a624 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmull.c @@ -0,0 +1,86 @@ +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +/* Expected values of cumulative_saturation flag. */ +int VECT_VAR(expected_cumulative_sat,int,16,4) = 0; +int VECT_VAR(expected_cumulative_sat,int,32,2) = 0; + +/* Expected results. */ +VECT_VAR_DECL(expected,int,32,4) [] = { 0x200, 0x1c2, 0x188, 0x152 }; +VECT_VAR_DECL(expected,int,64,2) [] = { 0x200, 0x1c2 }; + +/* Expected values of cumulative_saturation flag when saturation + occurs. */ +int VECT_VAR(expected_cumulative_sat2,int,16,4) = 1; +int VECT_VAR(expected_cumulative_sat2,int,32,2) = 1; + +/* Expected results when saturation occurs. */ +VECT_VAR_DECL(expected2,int,32,4) [] = { 0x7fffffff, 0x7fffffff, + 0x7fffffff, 0x7fffffff }; +VECT_VAR_DECL(expected2,int,64,2) [] = { 0x7fffffffffffffff, + 0x7fffffffffffffff }; + +#define INSN_NAME vqdmull +#define TEST_MSG "VQDMULL" + +#define FNNAME1(NAME) exec_ ## NAME +#define FNNAME(NAME) FNNAME1(NAME) + +void FNNAME (INSN_NAME) (void) +{ + /* Basic test: y=vqdmull(x,x), then store the result. */ +#define TEST_VQDMULL2(INSN, T1, T2, W, W2, N, EXPECTED_CUMULATIVE_SAT, CMT) \ + Set_Neon_Cumulative_Sat(0, VECT_VAR(vector_res, T1, W2, N)); \ + VECT_VAR(vector_res, T1, W2, N) = \ + INSN##_##T2##W(VECT_VAR(vector, T1, W, N), \ + VECT_VAR(vector2, T1, W, N)); \ + vst1q_##T2##W2(VECT_VAR(result, T1, W2, N), \ + VECT_VAR(vector_res, T1, W2, N)); \ + CHECK_CUMULATIVE_SAT(TEST_MSG, T1, W, N, EXPECTED_CUMULATIVE_SAT, CMT) + + /* Two auxliary macros are necessary to expand INSN. */ +#define TEST_VQDMULL1(INSN, T1, T2, W, W2, N, EXPECTED_CUMULATIVE_SAT, CMT) \ + TEST_VQDMULL2(INSN, T1, T2, W, W2, N, EXPECTED_CUMULATIVE_SAT, CMT) + +#define TEST_VQDMULL(T1, T2, W, W2, N, EXPECTED_CUMULATIVE_SAT, CMT) \ + TEST_VQDMULL1(INSN_NAME, T1, T2, W, W2, N, EXPECTED_CUMULATIVE_SAT, CMT) + + DECL_VARIABLE(vector, int, 16, 4); + DECL_VARIABLE(vector, int, 32, 2); + DECL_VARIABLE(vector2, int, 16, 4); + DECL_VARIABLE(vector2, int, 32, 2); + DECL_VARIABLE(vector_res, int, 32, 4); + DECL_VARIABLE(vector_res, int, 64, 2); + + clean_results (); + + VLOAD(vector, buffer, , int, s, 16, 4); + VLOAD(vector, buffer, , int, s, 32, 2); + VLOAD(vector2, buffer, , int, s, 16, 4); + VLOAD(vector2, buffer, , int, s, 32, 2); + + TEST_VQDMULL(int, s, 16, 32, 4, expected_cumulative_sat, ""); + TEST_VQDMULL(int, s, 32, 64, 2, expected_cumulative_sat, ""); + + CHECK (TEST_MSG, int, 32, 4, PRIx16, expected, ""); + CHECK (TEST_MSG, int, 64, 2, PRIx32, expected, ""); + + VDUP(vector, , int, s, 16, 4, 0x8000); + VDUP(vector2, , int, s, 16, 4, 0x8000); + VDUP(vector, , int, s, 32, 2, 0x80000000); + VDUP(vector2, , int, s, 32, 2, 0x80000000); + +#define TEST_MSG2 "with saturation" + TEST_VQDMULL(int, s, 16, 32, 4, expected_cumulative_sat2, TEST_MSG2); + TEST_VQDMULL(int, s, 32, 64, 2, expected_cumulative_sat2, TEST_MSG2); + + CHECK (TEST_MSG, int, 32, 4, PRIx16, expected2, TEST_MSG2); + CHECK (TEST_MSG, int, 64, 2, PRIx32, expected2, TEST_MSG2); +} + +int main (void) +{ + FNNAME (INSN_NAME) (); + return 0; +}