From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103478 invoked by alias); 9 Apr 2015 14:37:19 -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 103447 invoked by uid 89); 9 Apr 2015 14:37:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f176.google.com Received: from mail-ig0-f176.google.com (HELO mail-ig0-f176.google.com) (209.85.213.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 09 Apr 2015 14:37:16 +0000 Received: by igblo3 with SMTP id lo3so68146521igb.1 for ; Thu, 09 Apr 2015 07:37:14 -0700 (PDT) X-Received: by 10.107.136.25 with SMTP id k25mr45729838iod.88.1428590234247; Thu, 09 Apr 2015 07:37:14 -0700 (PDT) Received: from msticlxl57.ims.intel.com (fmdmzpr01-ext.fm.intel.com. [192.55.54.36]) by mx.google.com with ESMTPSA id k37sm862911iod.39.2015.04.09.07.37.11 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Apr 2015 07:37:13 -0700 (PDT) Date: Thu, 09 Apr 2015 14:37:00 -0000 From: Kirill Yukhin To: GCC Patches Cc: Uros Bizjak Subject: [PATCH, i386] Fix PR target/65671. Generate 32x4 extract even for DF in absence of AVX-512DQ. Message-ID: <20150409143658.GA48753@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00394.txt.bz2 Hello, Patch in the bottom fixes PR target/65671. It simply generates vextract32x4 (float form) for double extract. Bootstrap & regtesting in progress. I'll check it in if pass and back port to 4.9.x. Feel free comment. gcc/ * config/i386/sse.md: Generate vextract32x4 if AVX-512DQ is disabled. gcc/testsuite/ * gcc.target/i386/pr65671.c: New. -- Thanks, K commit cb8d5b1c3156d81ae81600217d0861be1aade0ec Author: Kirill Yukhin Date: Thu Apr 9 13:05:54 2015 +0300 Fix PR target/65671. Generate 32x4 extract even for DF in absence of AVX-512DQ. diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 490fd6b..6d3b54a 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -7015,10 +7015,15 @@ (vec_select: (match_operand:VI8F_256 1 "register_operand" "v,v") (parallel [(const_int 2) (const_int 3)])))] - "TARGET_AVX" + "TARGET_AVX && && " { - if (TARGET_AVX512DQ && TARGET_AVX512VL) - return "vextract64x2\t{$0x1, %1, %0|%0, %1, 0x1}"; + if (TARGET_AVX512VL) + { + if (TARGET_AVX512DQ) + return "vextract64x2\t{$0x1, %1, %0|%0, %1, 0x1}"; + else + return "vextract32x4\t{$0x1, %1, %0|%0, %1, 0x1}"; + } else return "vextract\t{$0x1, %1, %0|%0, %1, 0x1}"; } diff --git a/gcc/testsuite/gcc.target/i386/pr65671.c b/gcc/testsuite/gcc.target/i386/pr65671.c new file mode 100644 index 0000000..8e5d00d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr65671.c @@ -0,0 +1,15 @@ +/* PR target/65671 */ +/* { dg-do assemble } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mavx512vl -ffixed-ymm16" } */ + +#include + +register __m256d a asm ("ymm16"); +__m128d b; + +void +foo () +{ + b = _mm256_extractf128_pd (a, 1); +}