From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34154 invoked by alias); 1 May 2015 15:12:54 -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 33526 invoked by uid 89); 1 May 2015 15:12:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 May 2015 15:12:53 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by uk-mta-7.uk.mimecast.lan; Fri, 01 May 2015 16:12:50 +0100 Received: from [10.2.207.65] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 1 May 2015 16:12:50 +0100 Message-ID: <554397F2.80901@arm.com> Date: Fri, 01 May 2015 15:12:00 -0000 From: Alan Lawrence User-Agent: Thunderbird 2.0.0.24 (X11/20101213) MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH 1/3] optabs.c: Make vector_compare_rtx cope with VOIDmode constants (e.g. const0_rtx) References: <55312945.8010905@arm.com> In-Reply-To: <55312945.8010905@arm.com> X-MC-Unique: fGVEfBwUQJ2n4BTe8KXbSA-1 Content-Type: multipart/mixed; boundary="------------040809040100010006020701" X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00060.txt.bz2 This is a multi-part message in MIME format. --------------040809040100010006020701 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 332 Alan Lawrence wrote: > As per introduction, this allows vector_compare_rtx to work on DImode vec= tors. >=20 > Bootstrapped + check-gcc on x86-unknown-linux-gnu. >=20 > gcc/ChangeLog: >=20 > * optabs.c (vector_compare_rtx): Handle RTL operands having VOIDmode. >=20 Ping. (DImode vectors are explicitly allowed by stor-layout.c.) --------------040809040100010006020701 Content-Type: text/x-patch; name=vec_cmp_rtx.patch Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="vec_cmp_rtx.patch" Content-length: 1501 diff --git a/gcc/optabs.c b/gcc/optabs.c index f8d584eeeb11a2c19d8c8d887a0ff18aed5f56b4..135c88938f8bc03eed4dc7f1b5a= dcb0bb0606b1e 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -6530,18 +6530,28 @@ vector_compare_rtx (enum tree_code tcode, tree t_op= 0, tree t_op1, { struct expand_operand ops[2]; rtx rtx_op0, rtx_op1; + machine_mode m0, m1; enum rtx_code rcode =3D get_rtx_code (tcode, unsignedp); =20 gcc_assert (TREE_CODE_CLASS (tcode) =3D=3D tcc_comparison); =20 - /* Expand operands. */ + /* Expand operands. For vector types with scalar modes, e.g. where int6= 4x1_t + has mode DImode, this can produce a constant RTX of mode VOIDmode; in= such + cases, use the original mode. */ rtx_op0 =3D expand_expr (t_op0, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op0)), EXPAND_STACK_PARM); + m0 =3D GET_MODE (rtx_op0); + if (m0 =3D=3D VOIDmode) + m0 =3D TYPE_MODE (TREE_TYPE (t_op0)); + rtx_op1 =3D expand_expr (t_op1, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op1)), EXPAND_STACK_PARM); + m1 =3D GET_MODE (rtx_op1); + if (m1 =3D=3D VOIDmode) + m1 =3D TYPE_MODE (TREE_TYPE (t_op1)); =20 - create_input_operand (&ops[0], rtx_op0, GET_MODE (rtx_op0)); - create_input_operand (&ops[1], rtx_op1, GET_MODE (rtx_op1)); + create_input_operand (&ops[0], rtx_op0, m0); + create_input_operand (&ops[1], rtx_op1, m1); if (!maybe_legitimize_operands (icode, 4, 2, ops)) gcc_unreachable (); return gen_rtx_fmt_ee (rcode, VOIDmode, ops[0].value, ops[1].value); --------------040809040100010006020701--