From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23527 invoked by alias); 13 Jan 2015 15:19:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 22939 invoked by uid 89); 13 Jan 2015 15:19:10 -0000 Authentication-Results: sourceware.org; auth=none 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-wi0-f178.google.com Received: from mail-wi0-f178.google.com (HELO mail-wi0-f178.google.com) (209.85.212.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 13 Jan 2015 15:19:09 +0000 Received: by mail-wi0-f178.google.com with SMTP id em10so4627978wid.5 for ; Tue, 13 Jan 2015 07:19:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=YSnH8aqU6P32STJx2mndeVJzjImxx/rY4FSwPDCaPbA=; b=Bhx7NfRco73ReRLtP1HgMpfPGuSe82w2m1nFsqUskOqgqNaOpn3Xq7RNf+YjjMJXla tY6lIluLTAxOiYVlFCm++v7vWGqd40cw3Ldjp4FO27a8JpAG8p+B17OGK/jMDDneA7f3 luyWz3ErGk/+I9xU9603lV264USHRatZiLs3HbZkPxD1dg866khYcekxYi9T5plbxIST yYL3tDqeImYq/qNHpZfS6RLztpAQUaiN2/K21zkfAPXr8pY8/el+BthZ2aqzPHgbB5eJ 1A+k0+cph0dIHp7WxfPqzvG58PJ4c2yyboGhvyKAf8WpDcBU8DTuSa3DFZKk6MNIYbIL hWRQ== X-Gm-Message-State: ALoCoQm3firwgts4J8QaH1ZTaoy5Hb4oXD1bNBHYqQdmh1MRcXipU3DF4QBVS3NHihp/g/7FvOAg X-Received: by 10.180.211.2 with SMTP id my2mr8255895wic.3.1421162345834; Tue, 13 Jan 2015 07:19:05 -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.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jan 2015 07:19:05 -0800 (PST) From: Christophe Lyon To: gcc-patches@gcc.gnu.org Subject: [[ARM/AArch64][testsuite] 15/36] Add vqdmlal_lane and vqdmlsl_lane tests. Date: Tue, 13 Jan 2015 15:19:00 -0000 Message-Id: <1421162314-25779-16-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-SW-Source: 2015-01/txt/msg00858.txt.bz2 * gcc.target/aarch64/advsimd-intrinsics/vqdmlXl_lane.inc: New file. * gcc.target/aarch64/advsimd-intrinsics/vqdmlal_lane.c: New file. * gcc.target/aarch64/advsimd-intrinsics/vqdmlsl_lane.c: New file. diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlXl_lane.inc b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlXl_lane.inc new file mode 100644 index 0000000..705f90a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlXl_lane.inc @@ -0,0 +1,73 @@ +#define FNNAME1(NAME) exec_ ## NAME +#define FNNAME(NAME) FNNAME1(NAME) + +void FNNAME (INSN_NAME) (void) +{ + /* vector_res = vqdmlXl_lane(vector, vector3, vector4, lane), + then store the result. */ +#define TEST_VQDMLXL_LANE1(INSN, T1, T2, W, W2, N, V, 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), \ + V); \ + 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_LANE(INSN, T1, T2, W, W2, N, V, EXPECTED_CUMULATIVE_SAT, CMT) \ + TEST_VQDMLXL_LANE1(INSN, T1, T2, W, W2, N, V, 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_LANE(INSN_NAME, int, s, 32, 16, 4, 0, expected_cumulative_sat, ""); + TEST_VQDMLXL_LANE(INSN_NAME, int, s, 64, 32, 2, 0, expected_cumulative_sat, ""); + + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, ""); + CHECK(TEST_MSG, int, 64, 2, PRIx64, expected, ""); + +#define TEST_MSG2 "(mul with input=0)" + VDUP(vector3, , int, s, 16, 4, 0); + VDUP(vector3, , int, s, 32, 2, 0); + TEST_VQDMLXL_LANE(INSN_NAME, int, s, 32, 16, 4, 0, expected_cumulative_sat2, TEST_MSG2); + TEST_VQDMLXL_LANE(INSN_NAME, int, s, 64, 32, 2, 0, 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); + +#define TEST_MSG3 "(mul with saturation)" + VDUP(vector3, , int, s, 16, 4, 0x8000); + VDUP(vector3, , int, s, 32, 2, 0x80000000); + VDUP(vector4, , int, s, 16, 4, 0x8000); + VDUP(vector4, , int, s, 32, 2, 0x80000000); + TEST_VQDMLXL_LANE(INSN_NAME, int, s, 32, 16, 4, 0, expected_cumulative_sat3, TEST_MSG3); + TEST_VQDMLXL_LANE(INSN_NAME, int, s, 64, 32, 2, 0, expected_cumulative_sat3, TEST_MSG3); + + CHECK(TEST_MSG, int, 32, 4, PRIx32, expected3, TEST_MSG3); + CHECK(TEST_MSG, int, 64, 2, PRIx64, expected3, TEST_MSG3); +} + +int main (void) +{ + FNNAME (INSN_NAME) (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlal_lane.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlal_lane.c new file mode 100644 index 0000000..832a705 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlal_lane.c @@ -0,0 +1,38 @@ +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +#define INSN_NAME vqdmlal_lane +#define TEST_MSG "VQDMLAL_LANE" + +/* 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 multiplying with + 0. */ +int VECT_VAR(expected_cumulative_sat2,int,32,4) = 0; +int VECT_VAR(expected_cumulative_sat2,int,64,2) = 0; + +/* Expected values when multiplying with 0. */ +VECT_VAR_DECL(expected2,int,32,4) [] = { 0xfffffff0, 0xfffffff1, + 0xfffffff2, 0xfffffff3 }; +VECT_VAR_DECL(expected2,int,64,2) [] = { 0xfffffffffffffff0, + 0xfffffffffffffff1 }; + +/* Expected values of cumulative_saturation flag when multiplication + saturates. */ +int VECT_VAR(expected_cumulative_sat3,int,32,4) = 1; +int VECT_VAR(expected_cumulative_sat3,int,64,2) = 1; + +/* Expected values when multiplication saturates. */ +VECT_VAR_DECL(expected3,int,32,4) [] = { 0x7fffffef, 0x7ffffff0, + 0x7ffffff1, 0x7ffffff2 }; +VECT_VAR_DECL(expected3,int,64,2) [] = { 0x7fffffffffffffef, + 0x7ffffffffffffff0 }; + +#include "vqdmlXl_lane.inc" diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlsl_lane.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlsl_lane.c new file mode 100644 index 0000000..b95e61c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vqdmlsl_lane.c @@ -0,0 +1,40 @@ +#include +#include "arm-neon-ref.h" +#include "compute-ref-data.h" + +#define INSN_NAME vqdmlsl_lane +#define TEST_MSG "VQDMLSL_LANE" + +/* 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 multiplying with + 0. */ +int VECT_VAR(expected_cumulative_sat2,int,32,4) = 0; +int VECT_VAR(expected_cumulative_sat2,int,64,2) = 0; + +/* Expected values when multiplying with 0. */ +VECT_VAR_DECL(expected2,int,32,4) [] = { 0xfffffff0, 0xfffffff1, + 0xfffffff2, 0xfffffff3 }; +VECT_VAR_DECL(expected2,int,64,2) [] = { 0xfffffffffffffff0, + 0xfffffffffffffff1 }; + +/* Expected values of cumulative_saturation flag when multiplication + saturates. */ +int VECT_VAR(expected_cumulative_sat3,int,32,4) = 1; +int VECT_VAR(expected_cumulative_sat3,int,64,2) = 1; + +/* Expected values when multiplication saturates. */ +VECT_VAR_DECL(expected3,int,32,4) [] = { 0x80000000, 0x80000000, + 0x80000000, 0x80000000 }; +VECT_VAR_DECL(expected3,int,64,2) [] = { 0x8000000000000000, + 0x8000000000000000 }; + +#include "vqdmlXl_lane.inc" -- 2.1.0