From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19778 invoked by alias); 14 Dec 2009 19:39:25 -0000 Received: (qmail 19733 invoked by uid 22791); 14 Dec 2009 19:39:24 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Dec 2009 19:39:21 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBEJdJH6019826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Dec 2009 14:39:20 -0500 Received: from hs20-bc2-1.build.redhat.com (hs20-bc2-1.build.redhat.com [10.10.28.34]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBEJdJ9U012744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Dec 2009 14:39:19 -0500 Received: from hs20-bc2-1.build.redhat.com (localhost.localdomain [127.0.0.1]) by hs20-bc2-1.build.redhat.com (8.13.1/8.13.1) with ESMTP id nBEJdISl011300; Mon, 14 Dec 2009 14:39:18 -0500 Received: (from jakub@localhost) by hs20-bc2-1.build.redhat.com (8.13.1/8.13.1/Submit) id nBEJdIsF011296; Mon, 14 Dec 2009 14:39:18 -0500 Date: Mon, 14 Dec 2009 20:15:00 -0000 From: Jakub Jelinek To: Richard Henderson Cc: "H.J. Lu" , Sebastian Pop , gcc-patches@gcc.gnu.org, Uros Bizjak Subject: Re: PATCH: Add LWP support for upcoming AMD Orochi processor. Message-ID: <20091214193918.GT22813@hs20-bc2-1.build.redhat.com> Reply-To: Jakub Jelinek References: <20091210210945.GF22813@hs20-bc2-1.build.redhat.com> <20091211145001.GI22813@hs20-bc2-1.build.redhat.com> <20091211213422.GJ22813@hs20-bc2-1.build.redhat.com> <6dc9ffc80912141100s41ee053dx2d5e723db5e7555d@mail.gmail.com> <20091214190835.GS22813@hs20-bc2-1.build.redhat.com> <4B268E01.1090903@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B268E01.1090903@redhat.com> User-Agent: Mutt/1.4.1i X-IsSubscribed: yes 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 X-SW-Source: 2009-12/txt/msg00738.txt.bz2 On Mon, Dec 14, 2009 at 11:12:01AM -0800, Richard Henderson wrote: > On 12/14/2009 11:08 AM, Jakub Jelinek wrote: > >+ /* These 2 codes can't use case labels, as > >+ in 32-bit only target builds they are both > >+ CODE_FOR_nothing. */ > >+ if (TARGET_64BIT > >+ && (icode == CODE_FOR_lwp_lwpvaldi3 > >+ || icode == CODE_FOR_lwp_lwpinsdi3)) > > I wonder if it just wouldn't be easier to use an IF here. > You don't need the TARGET_64BIT since we know icode != CODE_FOR_nothing. This works of course too. I used the switch just because there was one already (with just default: label and no other cases). Whatever you prefer... 2009-12-14 Jakub Jelinek PR bootstrap/42369 * config/i386/i386.c (ix86_expand_special_args_builtin): Avoid using switch with CODE_FOR_lwp_lwp* cases. --- gcc/config/i386/i386.c.jj 2009-12-14 17:50:14.000000000 +0100 +++ gcc/config/i386/i386.c 2009-12-14 20:34:03.000000000 +0100 @@ -23836,19 +23836,16 @@ ix86_expand_special_args_builtin (const if (last_arg_constant && (i + 1) == nargs) { if (!match) - switch (icode) - { - case CODE_FOR_lwp_lwpvalsi3: - case CODE_FOR_lwp_lwpvaldi3: - case CODE_FOR_lwp_lwpinssi3: - case CODE_FOR_lwp_lwpinsdi3: + { + if (icode == CODE_FOR_lwp_lwpvalsi3 + || icode == CODE_FOR_lwp_lwpinssi3 + || icode == CODE_FOR_lwp_lwpvaldi3 + || icode == CODE_FOR_lwp_lwpinsdi3) error ("the last argument must be a 32-bit immediate"); - return const0_rtx; - - default: + else error ("the last argument must be an 8-bit immediate"); - return const0_rtx; - } + return const0_rtx; + } } else { Jakub