From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4520 invoked by alias); 16 Jan 2015 18:39:36 -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 4509 invoked by uid 89); 16 Jan 2015 18:39:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Jan 2015 18:39:34 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by service87.mimecast.com; Fri, 16 Jan 2015 18:39:31 +0000 Received: from [10.1.203.161] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 16 Jan 2015 18:39:29 +0000 Message-ID: <54B95B0A.6080207@arm.com> Date: Fri, 16 Jan 2015 18:49:00 -0000 From: Tejas Belagod User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Christophe Lyon , "gcc-patches@gcc.gnu.org" Subject: Re: [[ARM/AArch64][testsuite] 36/36] Add vqdmull_n tests. References: <1421162314-25779-1-git-send-email-christophe.lyon@linaro.org> <1421162314-25779-37-git-send-email-christophe.lyon@linaro.org> In-Reply-To: <1421162314-25779-37-git-send-email-christophe.lyon@linaro.org> X-MC-Unique: 115011618393104701 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg01470.txt.bz2 On 13/01/15 15:18, Christophe Lyon wrote: > * 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) =3D 0; > +int VECT_VAR(expected_cumulative_sat,int,32,2) =3D 0; > + > +/* Expected results. */ > +VECT_VAR_DECL(expected,int,32,4) [] =3D { 0x44000, 0x44000, > + 0x44000, 0x44000 }; > +VECT_VAR_DECL(expected,int,64,2) [] =3D { 0xaa000, 0xaa000 }; > + > +/* Expected values of cumulative_saturation flag when saturation > + occurs. */ > +int VECT_VAR(expected_cumulative_sat2,int,16,4) =3D 1; > +int VECT_VAR(expected_cumulative_sat2,int,32,2) =3D 1; > + > +/* Expected results when saturation occurs. */ > +VECT_VAR_DECL(expected2,int,32,4) [] =3D { 0x7fffffff, 0x7fffffff, > + 0x7fffffff, 0x7fffffff }; > +VECT_VAR_DECL(expected2,int,64,2) [] =3D { 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 =3D vqdmull_n(vector,val), then store the result. */ > +#define TEST_VQDMULL_N2(INSN, T1, T2, W, W2, N, L, EXPECTED_CUMULATIVE_S= AT, CMT) \ > + Set_Neon_Cumulative_Sat(0, VECT_VAR(vector_res, T1, W2, N)); \ > + VECT_VAR(vector_res, T1, W2, N) =3D \ > + 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_S= AT, CMT) \ > + TEST_VQDMULL_N2(INSN, T1, T2, W, W2, N, L, EXPECTED_CUMULATIVE_SAT, CM= T) > + > +#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_SA= T, 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, TE= ST_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; > +} > Patches 31 to 36 also LGTM. A general nit about all the patches. Code like: + 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); A space before the '(' is required. Thanks for working on these tests. Tejas.