From patchwork Mon Nov 30 10:46:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Yukhin X-Patchwork-Id: 549926 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A87CB140271 for ; Mon, 30 Nov 2015 21:46:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=BOQ/Qdod; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=VH1OIRrkdi8waBno3+au40ei/B61v66C9YKfs0aqmG3VCHaRbT 5t54bpEWVaGuZeUDa7ce9Wcs+EfegYIx/K2xQBXtWuu4MZoWpeOiH0dVc0LR77a9 jQ8vuzSX9wwir/XDej6LHW/qnRJvQUIvImh1oaY3pt2xq06cFx0UhIVA0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=Plgleb4ed+d4B7hsY9TqmLf4saY=; b=BOQ/QdodA5GQZcK2EP3I f8u5hDrbG/sKFqYimz1iQ2SUoQ1//lrJRPGQuu8K1H9GkIYYyue92JPnTznPkCmR bYSkTDxjlBsA7/YWe1ZpihihX0Kjv+xymCIgHa0iQ7O3OGKs+rBl3HwYPAGjGg0z yM0d9fpNm2MkPV3JH0tt3Yo= Received: (qmail 78642 invoked by alias); 30 Nov 2015 10:46:36 -0000 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 Received: (qmail 78611 invoked by uid 89); 30 Nov 2015 10:46:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-io0-f181.google.com Received: from mail-io0-f181.google.com (HELO mail-io0-f181.google.com) (209.85.223.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 30 Nov 2015 10:46:33 +0000 Received: by ioir85 with SMTP id r85so168653451ioi.1 for ; Mon, 30 Nov 2015 02:46:31 -0800 (PST) X-Received: by 10.107.16.18 with SMTP id y18mr59011298ioi.113.1448880391824; Mon, 30 Nov 2015 02:46:31 -0800 (PST) Received: from msticlxl57.ims.intel.com (irdmzpr01-ext.ir.intel.com. [192.198.151.36]) by smtp.gmail.com with ESMTPSA id 42sm17439601iom.6.2015.11.30.02.46.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Nov 2015 02:46:30 -0800 (PST) Date: Mon, 30 Nov 2015 13:46:03 +0300 From: Kirill Yukhin To: GCC Patches Cc: Uros Bizjak Subject: [PATCH, i386, AVX-512] Split out mask version for vec_extract_hi_. Message-ID: <20151130104601.GA24154@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hello, Patch in the bottom splits masked version of vec_extract_hi_ to block AVX-1512VL insn generation for KNL and cures ICE on spec2k6/450.soplex. Bootstrapped and regtesed. If no objections - I'll commit on Wednesday. gcc/ * config/i386/sse.md (define_insn "vec_extract_hi__maskm"): Remove "prefix_extra". (define_insn "vec_extract_hi__mask"): New. (define_insn "vec_extract_hi_"): Remove masking. gcc/testsuite/ * gcc.target/i386/avx512vl-vextractf32x4-1.c: Fix scan pattern. --- Thanks, K commit 69b2f7270d33def74a4cc9579def5d6cb950577d Author: Kirill Yukhin Date: Thu Nov 26 15:32:47 2015 +0300 AVX-512. Fix vec_extract_hi_ constraints. diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index e7b517a..680d813 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -7534,32 +7534,40 @@ && rtx_equal_p (operands[2], operands[0])" "vextract32x4\t{$0x1, %1, %0%{%3%}|%0%{%3%}, %1, 0x1}" [(set_attr "type" "sselog1") - (set_attr "prefix_extra" "1") (set_attr "length_immediate" "1") (set_attr "prefix" "evex") (set_attr "mode" "")]) -(define_insn "vec_extract_hi_" - [(set (match_operand: 0 "" "=") +(define_insn "vec_extract_hi__mask" + [(set (match_operand: 0 "register_operand" "=v") + (vec_merge: + (vec_select: + (match_operand:VI4F_256 1 "register_operand" "v") + (parallel [(const_int 4) (const_int 5) + (const_int 6) (const_int 7)])) + (match_operand: 2 "vector_move_operand" "0C") + (match_operand: 3 "register_operand" "Yk")))] + "TARGET_AVX512VL" + "vextract32x4\t{$0x1, %1, %0%{%3%}%N2|%0%{%3%}%N2, %1, 0x1}" + [(set_attr "type" "sselog1") + (set_attr "length_immediate" "1") + (set_attr "prefix" "evex") + (set_attr "mode" "")]) + +(define_insn "vec_extract_hi_" + [(set (match_operand: 0 "nonimmediate_operand" "=xm, vm") (vec_select: - (match_operand:VI4F_256 1 "register_operand" "v") + (match_operand:VI4F_256 1 "register_operand" "x, v") (parallel [(const_int 4) (const_int 5) (const_int 6) (const_int 7)])))] - "TARGET_AVX && " -{ - if (TARGET_AVX512VL) - return "vextract32x4\t{$0x1, %1, %0|%0, %1, 0x1}"; - else - return "vextract\t{$0x1, %1, %0|%0, %1, 0x1}"; -} - [(set_attr "type" "sselog1") - (set_attr "prefix_extra" "1") + "TARGET_AVX" + "@ + vextract\t{$0x1, %1, %0|%0, %1, 0x1} + vextract32x4\t{$0x1, %1, %0|%0, %1, 0x1}" + [(set_attr "isa" "*, avx512vl") + (set_attr "prefix" "vex, evex") + (set_attr "type" "sselog1") (set_attr "length_immediate" "1") - (set (attr "prefix") - (if_then_else - (match_test "TARGET_AVX512VL") - (const_string "evex") - (const_string "vex"))) (set_attr "mode" "")]) (define_insn_and_split "vec_extract_lo_v32hi" diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vextractf32x4-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vextractf32x4-1.c index c01835c..26313f4 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vextractf32x4-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vextractf32x4-1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-mavx512vl -O2" } */ -/* { dg-final { scan-assembler-times "vextractf32x4\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vextractf(?:128|32x4)\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextractf32x4\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vextractf32x4\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */