From patchwork Tue Jan 13 15:18:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 43053 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 30A0620DE8 for ; Tue, 13 Jan 2015 15:29:12 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id q1sf2052342lam.2 for ; Tue, 13 Jan 2015 07:29:11 -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=tP944g93q11oLZPYE9mpZd5qSVidcEpfCdy03s8gAOk=; b=AuDA0y9pEGXpd51QPZEjFKBjgrnR2v7jGNtO+WBqM1FuDgBOge4w1PEkKwLqBRDw8G DYv3VC2nmgVwd0+QT8VBLHwfMXekM9VSGGju90jdeOjWUJiofHgMTv424d6+hTI8GQ14 wnxnFlQX83+qGWlJ2LsYqrOX6xjdwv7XQzNopumWN+bp8DZnyZKdp6OdoyRj+CN9O+mB ea1JvuA4VuzBbF3HLwzaSGCgWAz2Xn6Q4dR11IduiYQRah6mWtMpj7fTYRfIcEfPtN1R DLYt74BlA/eqDI2ye1qWkHKmjEBZVpZP0oVALWBmg6fsCnvMPGhH8x7fz2TafYEURtau Ymag== X-Gm-Message-State: ALoCoQkNeLo1QGIqDQ/Bg9LIfsslvorTLpJOcckQ83knstxWAH6oLrgyby/Z3Sihhs0Wz/KlYoKC X-Received: by 10.152.2.40 with SMTP id 8mr371484lar.7.1421162951054; Tue, 13 Jan 2015 07:29:11 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.130 with SMTP id f2ls11253lae.21.gmail; Tue, 13 Jan 2015 07:29:10 -0800 (PST) X-Received: by 10.112.72.197 with SMTP id f5mr42158591lbv.21.1421162950902; Tue, 13 Jan 2015 07:29:10 -0800 (PST) Received: from mail-lb0-x22a.google.com (mail-lb0-x22a.google.com. [2a00:1450:4010:c04::22a]) by mx.google.com with ESMTPS id ql3si24489056lbb.133.2015.01.13.07.29.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 07:29:10 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22a as permitted sender) client-ip=2a00:1450:4010:c04::22a; Received: by mail-lb0-f170.google.com with SMTP id 10so3172531lbg.1 for ; Tue, 13 Jan 2015 07:29:10 -0800 (PST) X-Received: by 10.152.8.11 with SMTP id n11mr41020376laa.38.1421162950792; Tue, 13 Jan 2015 07:29:10 -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 c8csp1416216lbb; Tue, 13 Jan 2015 07:29:09 -0800 (PST) X-Received: by 10.69.26.130 with SMTP id iy2mr52430285pbd.93.1421162948885; Tue, 13 Jan 2015 07:29:08 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id qy3si27160653pbc.234.2015.01.13.07.29.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jan 2015 07:29:08 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-389062-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 26680 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 25388 invoked by uid 89); 13 Jan 2015 15:19:37 -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-f174.google.com Received: from mail-we0-f174.google.com (HELO mail-we0-f174.google.com) (74.125.82.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 13 Jan 2015 15:19:35 +0000 Received: by mail-we0-f174.google.com with SMTP id k48so3501582wev.5 for ; Tue, 13 Jan 2015 07:19:32 -0800 (PST) X-Received: by 10.180.20.6 with SMTP id j6mr40380032wie.59.1421162372290; Tue, 13 Jan 2015 07:19:32 -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.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jan 2015 07:19:31 -0800 (PST) From: Christophe Lyon To: gcc-patches@gcc.gnu.org Subject: [[ARM/AArch64][testsuite] 36/36] Add vqdmull_n tests. Date: Tue, 13 Jan 2015 16:18:34 +0100 Message-Id: <1421162314-25779-37-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::22a 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_n.c: New file. diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmull_n.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmull_n.c new file mode 100644 index 0000000..9e73009 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmull_n.c @@ -0,0 +1,92 @@ +#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) [] = { 0x44000, 0x44000, + 0x44000, 0x44000 }; +VECT_VAR_DECL(expected,int,64,2) [] = { 0xaa000, 0xaa000 }; + +/* 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_N" + +#define FNNAME1(NAME) exec_ ## NAME +#define FNNAME(NAME) FNNAME1(NAME) + +void FNNAME (INSN_NAME) (void) +{ + int i; + + /* vector_res = vqdmull_n(vector,val), then store the result. */ +#define TEST_VQDMULL_N2(INSN, T1, T2, W, W2, N, L, EXPECTED_CUMULATIVE_SAT, CMT) \ + Set_Neon_Cumulative_Sat(0, VECT_VAR(vector_res, T1, W2, N)); \ + VECT_VAR(vector_res, T1, W2, N) = \ + INSN##_n_##T2##W(VECT_VAR(vector, T1, W, N), \ + L); \ + 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_VQDMULL_N1(INSN, T1, T2, W, W2, N, L, EXPECTED_CUMULATIVE_SAT, CMT) \ + TEST_VQDMULL_N2(INSN, T1, T2, W, W2, N, L, EXPECTED_CUMULATIVE_SAT, CMT) + +#define TEST_VQDMULL_N(T1, T2, W, W2, N, L, EXPECTED_CUMULATIVE_SAT, CMT) \ + TEST_VQDMULL_N1(INSN_NAME, T1, T2, W, W2, N, L, 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 (); + + /* Initialize vector. */ + VDUP(vector, , int, s, 16, 4, 0x1000); + VDUP(vector, , int, s, 32, 2, 0x1000); + + /* Initialize vector2. */ + VDUP(vector2, , int, s, 16, 4, 0x4); + VDUP(vector2, , int, s, 32, 2, 0x2); + + /* Choose multiplier arbitrarily. */ + TEST_VQDMULL_N(int, s, 16, 32, 4, 0x22, expected_cumulative_sat, ""); + TEST_VQDMULL_N(int, s, 32, 64, 2, 0x55, expected_cumulative_sat, ""); + + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, ""); + CHECK(TEST_MSG, int, 64, 2, PRIx64, expected, ""); + + VDUP(vector, , int, s, 16, 4, 0x8000); + VDUP(vector, , int, s, 32, 2, 0x80000000); + +#define TEST_MSG2 "with saturation" + TEST_VQDMULL_N(int, s, 16, 32, 4, 0x8000, expected_cumulative_sat2, TEST_MSG2); + TEST_VQDMULL_N(int, s, 32, 64, 2, 0x80000000, expected_cumulative_sat2, TEST_MSG2); + + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected2, TEST_MSG2); + CHECK(TEST_MSG, int, 64, 2, PRIx64, expected2, TEST_MSG2); +} + +int main (void) +{ + FNNAME (INSN_NAME) (); + return 0; +}