From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 685 invoked by alias); 16 Jun 2011 22:57:27 -0000 Received: (qmail 677 invoked by uid 22791); 16 Jun 2011 22:57:26 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_MX X-Spam-Check-By: sourceware.org Received: from mail-pv0-f175.google.com (HELO mail-pv0-f175.google.com) (74.125.83.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Jun 2011 22:57:13 +0000 Received: by pvc30 with SMTP id 30so28134pvc.20 for ; Thu, 16 Jun 2011 15:57:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.51.167 with SMTP id l7mr847878pbo.290.1308265032181; Thu, 16 Jun 2011 15:57:12 -0700 (PDT) Received: by 10.68.47.69 with HTTP; Thu, 16 Jun 2011 15:57:12 -0700 (PDT) In-Reply-To: References: <20110615095406.GI17079@tyan-ft48-01.lab.bos.redhat.com> Date: Thu, 16 Jun 2011 23:18:00 -0000 Message-ID: Subject: Re: [PATCH] Fix ICEs with -mxop __builtin_ia32_vpermil2p[sd]{,256} and __builtin_ia32_vprot[bwdq]i intrinsics (PR target/49411) From: Quentin Neill To: Jakub Jelinek Cc: Uros Bizjak , Sebastian Pop , "Fang, Changpeng" , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2011-06/txt/msg01310.txt.bz2 On Thu, Jun 16, 2011 at 3:34 PM, Quentin Neill wrote: > On Wed, Jun 15, 2011 at 11:40 AM, Quentin Neill > wrote: >> On Wed, Jun 15, 2011 at 4:54 AM, Jakub Jelinek wrote: >>> Hi! >>> >>> All of these _mm{,256}_permute2_p[sd] and _mm_roti_epi{8,16,32,64} >>> intrinsics ICE if the last argument is constant integer, but not in the >>> expected range. >>> >>> I could only find MSFT documentation for these intrinsics, where for >>> *permute2* it says that the last argument must be 0, 1, 2 or 3, >>> for *roti* it says that the last argument is integer rotation count, >>> preferrably constant and that if count is negative, it performs right >>> rotation instead of left rotation. >>> This patch adjusts the builtins to match that, if we want to instead >>> e.g. always mandate _mm_roti_epi* last argument is constant integer, >>> or constant integer in the range -N+1 .. N-1 where N is the number >>> after _mm_roti_epi, or in the range 0 .. N-1, it can be easily adjusted. >>> >>> Regtested on x86_64-linux {-m32,-m64}, unfortunately on a SandyBridge >>> box, so I couldn't verify if xop-rotate[12]-int.c actually succeeds >>> on xop capable HW. >>> >>> [snip] >>> >>> =A0 =A0 =A0 =A0Jakub >>> >> >> I will test on AMD HW. >> -- >> Quentin > > Regtested on x86_64-linux on AMD Family 16h, and verified the > xop-rotate[12]-int tests ran and passed. > -- > Quentin Does it need to also handle the VCVTP[SH]2P[HS] insns like this? diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 675888f..584f722 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -25571,6 +25571,10 @@ ix86_expand_multi_arg_builtin (enum insn_code icode, tree exp, rtx target, case CODE_FOR_xop_vpermil2v4sf3: case CODE_FOR_xop_vpermil2v4df3: case CODE_FOR_xop_vpermil2v8sf3: + case CODE_FOR_vcvtph2ps: + case CODE_FOR_vcvtph2ps256: + case CODE_FOR_vcvtps2ph: + case CODE_FOR_vcvtps2ph256: if (!CONST_INT_P (op)) { error ("last argument must be an immediate"); --=20 Quentin