From patchwork Tue Jan 13 15:18:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 43031 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 37BC520DE8 for ; Tue, 13 Jan 2015 15:23:16 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id x12sf2040183wgg.0 for ; Tue, 13 Jan 2015 07:23:15 -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=U07VPr9IHFWzrWyTUIiyQLXSbHNbwSsxskhb0UjKfk0=; b=gmZC9jetD5eeJKPCt7EBApmsv7HSNJFVbqwrluS3ewRXhIVwfszuNVC/O08TxhJZii NP41G854IUfFf0A+kbltZR9/MiC4inDriimN/tVtvg3KN5xnHz/exPc96OrjlJ9LuqsQ WoeiN9vvCQLmGw5jGIp3TA0QeiKeeS7B5Jh0XyGBDoG3ebZfaBjGcLNmARUGxx4VKPqr vlluBnWK8PgHM1U3QV0zUCdjG80/P6q5seoyxl2UfAssd8z5dYHpWC1cE5nxaLxULzUL e1ZzsOinnW+2kS/YCd0mPR0u1y2/hObyLx+KbXEai/kNVNYPPLeN0viK66wIszSjYE5B prTQ== X-Gm-Message-State: ALoCoQlR2kbRL9MHlXnU7SNqv7Q7y59BRtwM9gSACiF1ON5mW6oNUMJnvOwg0i8OfjxNok6v4VmC X-Received: by 10.180.85.230 with SMTP id k6mr2496064wiz.1.1421162595489; Tue, 13 Jan 2015 07:23:15 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.242.129 with SMTP id wq1ls6961lac.56.gmail; Tue, 13 Jan 2015 07:23:15 -0800 (PST) X-Received: by 10.112.147.10 with SMTP id tg10mr43067203lbb.92.1421162595327; Tue, 13 Jan 2015 07:23:15 -0800 (PST) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com. [2a00:1450:4010:c03::22e]) by mx.google.com with ESMTPS id y9si24602382lbr.7.2015.01.13.07.23.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 07:23:15 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22e as permitted sender) client-ip=2a00:1450:4010:c03::22e; Received: by mail-la0-f46.google.com with SMTP id q1so3194535lam.5 for ; Tue, 13 Jan 2015 07:23:15 -0800 (PST) X-Received: by 10.112.64.35 with SMTP id l3mr42456467lbs.82.1421162595205; Tue, 13 Jan 2015 07:23:15 -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 c8csp1414576lbb; Tue, 13 Jan 2015 07:23:14 -0800 (PST) X-Received: by 10.66.228.200 with SMTP id sk8mr50937514pac.134.1421162593251; Tue, 13 Jan 2015 07:23:13 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id sp5si27218047pab.234.2015.01.13.07.23.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jan 2015 07:23:13 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-389040-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 23394 invoked by alias); 13 Jan 2015 15:19: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 22879 invoked by uid 89); 13 Jan 2015 15:19:09 -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-f51.google.com Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 13 Jan 2015 15:19:07 +0000 Received: by mail-wg0-f51.google.com with SMTP id x12so3532611wgg.10 for ; Tue, 13 Jan 2015 07:19:04 -0800 (PST) X-Received: by 10.180.208.76 with SMTP id mc12mr7412178wic.73.1421162344378; Tue, 13 Jan 2015 07:19:04 -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.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jan 2015 07:19:03 -0800 (PST) From: Christophe Lyon To: gcc-patches@gcc.gnu.org Subject: [[ARM/AArch64][testsuite] 14/36] Add vqdmlal and vqdmlsl tests. Date: Tue, 13 Jan 2015 16:18:12 +0100 Message-Id: <1421162314-25779-15-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:c03::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/vqdmlXl.inc: New file. * gcc.target/aarch64/advsimd-intrinsics/vqdmlal.c: New file. * gcc.target/aarch64/advsimd-intrinsics/vqdmlsl.c: New file. diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlXl.inc b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlXl.inc new file mode 100644 index 0000000..cd61fd4 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlXl.inc @@ -0,0 +1,63 @@ +#define FNNAME1(NAME) exec_ ## NAME +#define FNNAME(NAME) FNNAME1(NAME) + +void FNNAME (INSN_NAME) (void) +{ + /* vector_res = OP(vector, vector3, vector4), + then store the result. */ +#define TEST_VQDMLXL1(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##_##T2##W2(VECT_VAR(vector, T1, W, N), \ + VECT_VAR(vector3, T1, W2, N), \ + VECT_VAR(vector4, T1, W2, N)); \ + vst1q_##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_VQDMLXL(INSN, T1, T2, W, W2, N, EXPECTED_CUMULATIVE_SAT, CMT) \ + TEST_VQDMLXL1(INSN, T1, T2, W, W2, N, EXPECTED_CUMULATIVE_SAT, CMT) + + DECL_VARIABLE(vector, int, 32, 4); + DECL_VARIABLE(vector3, int, 16, 4); + DECL_VARIABLE(vector4, int, 16, 4); + DECL_VARIABLE(vector_res, int, 32, 4); + DECL_VARIABLE(vector, int, 64, 2); + DECL_VARIABLE(vector3, int, 32, 2); + DECL_VARIABLE(vector4, int, 32, 2); + DECL_VARIABLE(vector_res, int, 64, 2); + + clean_results (); + + VLOAD(vector, buffer, q, int, s, 32, 4); + VLOAD(vector, buffer, q, int, s, 64, 2); + + VDUP(vector3, , int, s, 16, 4, 0x55); + VDUP(vector4, , int, s, 16, 4, 0xBB); + VDUP(vector3, , int, s, 32, 2, 0x55); + VDUP(vector4, , int, s, 32, 2, 0xBB); + + TEST_VQDMLXL(INSN_NAME, int, s, 32, 16, 4, expected_cumulative_sat, ""); + TEST_VQDMLXL(INSN_NAME, int, s, 64, 32, 2, expected_cumulative_sat, ""); + + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, ""); + CHECK(TEST_MSG, int, 64, 2, PRIx64, expected, ""); + + VDUP(vector3, , int, s, 16, 4, 0x8000); + VDUP(vector4, , int, s, 16, 4, 0x8000); + VDUP(vector3, , int, s, 32, 2, 0x80000000); + VDUP(vector4, , int, s, 32, 2, 0x80000000); + +#define TEST_MSG2 "with saturation" + TEST_VQDMLXL(INSN_NAME, int, s, 32, 16, 4, expected_cumulative_sat2, TEST_MSG2); + TEST_VQDMLXL(INSN_NAME, int, s, 64, 32, 2, 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; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlal.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlal.c new file mode 100644 index 0000000..c53a90a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlal.c @@ -0,0 +1,27 @@ +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +#define INSN_NAME vqdmlal +#define TEST_MSG "VQDMLAL" + +/* Expected values of cumulative_saturation flag. */ +int VECT_VAR(expected_cumulative_sat,int,32,4) = 0; +int VECT_VAR(expected_cumulative_sat,int,64,2) = 0; + +/* Expected results. */ +VECT_VAR_DECL(expected,int,32,4) [] = { 0x7c1e, 0x7c1f, 0x7c20, 0x7c21 }; +VECT_VAR_DECL(expected,int,64,2) [] = { 0x7c1e, 0x7c1f }; + +/* Expected values of cumulative_saturation flag when saturation + occurs. */ +int VECT_VAR(expected_cumulative_sat2,int,32,4) = 1; +int VECT_VAR(expected_cumulative_sat2,int,64,2) = 1; + +/* Expected results when saturation occurs. */ +VECT_VAR_DECL(expected2,int,32,4) [] = { 0x7fffffef, 0x7ffffff0, + 0x7ffffff1, 0x7ffffff2 }; +VECT_VAR_DECL(expected2,int,64,2) [] = { 0x7fffffffffffffef, + 0x7ffffffffffffff0 }; + +#include "vqdmlXl.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlsl.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlsl.c new file mode 100644 index 0000000..56e0b61 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlsl.c @@ -0,0 +1,29 @@ +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +#define INSN_NAME vqdmlsl +#define TEST_MSG "VQDMLSL" + +/* Expected values of cumulative_saturation flag. */ +int VECT_VAR(expected_cumulative_sat,int,32,4) = 0; +int VECT_VAR(expected_cumulative_sat,int,64,2) = 0; + +/* Expected results. */ +VECT_VAR_DECL(expected,int,32,4) [] = { 0xffff83c2, 0xffff83c3, + 0xffff83c4, 0xffff83c5 }; +VECT_VAR_DECL(expected,int,64,2) [] = { 0xffffffffffff83c2, + 0xffffffffffff83c3 }; + +/* Expected values of cumulative_saturation flag when saturation + occurs. */ +int VECT_VAR(expected_cumulative_sat2,int,32,4) = 1; +int VECT_VAR(expected_cumulative_sat2,int,64,2) = 1; + +/* Expected results when saturation occurs. */ +VECT_VAR_DECL(expected2,int,32,4) [] = { 0x80000000, 0x80000000, + 0x80000000, 0x80000000 }; +VECT_VAR_DECL(expected2,int,64,2) [] = { 0x8000000000000000, + 0x8000000000000000 }; + +#include "vqdmlXl.inc"