From patchwork Thu May 10 20:15:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 158383 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 099F7B6FA3 for ; Fri, 11 May 2012 06:16:25 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1337285786; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:In-Reply-To:Message-ID:References:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=40q4d9lkLGs0MGQ23gCiYw/ro2Y=; b=APpYK2u1nVIx9rn RcvxsbZfGoNVnHdUez3vKt3inEVCP7Oz2rvmBXHBDhW0WoYMB6KJcz/cVqa3gWVv WquHiMLGP4Ubbygc0Rv3kANUZPWBArYLQdoJiLN1j36uerAwPEOtRpxOWYhxd38x HKAzyzMDsX3QGVlGYU/yuSr20+34= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Subject:In-Reply-To:Message-ID:References:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=FED1p4XOg9Av0YVi3mStjkvhdOA2J6KMYAlW1IYEhbI0VP2iRGWr28wyoGDuNX qSVJSqsHAB1Qd0k5JGGd/XgCEpRUd9cQKGBh2rC1kGjTzeqBqrdQmMgJqi1Ie5r5 qljgs9H9xUFoGCjghlxvuBmdRNLGlnH8A0MoODK2tDeTM=; Received: (qmail 22058 invoked by alias); 10 May 2012 20:16:04 -0000 Received: (qmail 22044 invoked by uid 22791); 10 May 2012 20:16:02 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail4-relais-sop.national.inria.fr (HELO mail4-relais-sop.national.inria.fr) (192.134.164.105) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 May 2012 20:15:48 +0000 Received: from ip-254.net-81-220-143.rev.numericable.fr (HELO laptop-mg.local) ([81.220.143.254]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 10 May 2012 22:15:46 +0200 Date: Thu, 10 May 2012 22:15:42 +0200 (CEST) From: Marc Glisse To: gcc-patches@gcc.gnu.org Subject: [i386] New testcase (was: [rtl, patch] combine concat+shuffle) In-Reply-To: Message-ID: References: <87d36epnjs.fsf@talisman.home> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hello, could an i386 maintainer take a look at the following testcase? gcc/testsuite/ChangeLog 2012-05-08 Marc Glisse * gcc.target/i386/shuf-concat.c: New test. The conversation on this patch started at http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00504.html On Tue, 8 May 2012, Marc Glisse wrote: > On Tue, 8 May 2012, Richard Sandiford wrote: > >> Marc Glisse writes: >>> Here is a new version. >>> >>> gcc/ChangeLog >>> 2012-05-08 Marc Glisse >>> >>> * simplify-rtx.c (simplify_binary_operation_1): Optimize shuffle >>> of concatenations. >> >> OK, thanks. I'll leave an x86 maintainer to review the testcase, >> but it looks like it'll need some markup to ensure an SSE target. > > Oups, I'd thought about that, then completely forgot. For 64 bits, it always > works. For 32 bits, it requires -msse2 -mfpmath=sse (without -mfpmath=sse we > can still test for shufpd, but apparently not unpcklpd, I could remove that > second test if people prefer, as it isn't important). Since this is a > compile-only test, I think this would be enough: > > /* { dg-options "-O -msse2 -mfpmath=sse" } */ > >>> Note to self: if you want to grep for "shuf" in the asm, don't put "shuf" >>> in the name of the file... >> >> Yeah :-) For MIPS tests I tend to add "\t" to the beginning of the regexp. >> (And to the end if possible.) > > Good idea. I was trying to make the check as wide as possible, but that's not > so useful. Attached a new version of the testcase. --- gcc.target/i386/shuf-concat.c (revision 0) +++ gcc.target/i386/shuf-concat.c (revision 0) @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O -msse2 -mfpmath=sse" } */ + +typedef double v2df __attribute__ ((__vector_size__ (16))); + +v2df f(double d,double e){ + v2df x={-d,d}; + v2df y={-e,e}; + return __builtin_ia32_shufpd(x,y,1); +} + +/* { dg-final { scan-assembler-not "\tv?shufpd\t" } } */ +/* { dg-final { scan-assembler-times "\tv?unpcklpd\t" 1 } } */