From patchwork Sun Jan 6 10:32:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1021064 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-493466-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="mnqX+fc6"; dkim-atps=neutral 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 43XZc76GS7z9s55 for ; Sun, 6 Jan 2019 21:33:10 +1100 (AEDT) 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:reply-to:mime-version :content-type; q=dns; s=default; b=qjxENjvp9eg8/ATul1kHX6E3U6FB3 gCUkX7nrm0fheKos6HFzW2v/bawA3PoQf+sAqHQzg7N7+0uPJz1YOnGF9X1zmLku nocpEknkpyrKtah5Kt4Y6dgdX80xdpaz83clKvi4ixVf7wLqwNCUhBqGxnHlzLEA vkRfl6og8r/KDU= 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:reply-to:mime-version :content-type; s=default; bh=WabAYSN+jV5qdqn6q49Y5/033AU=; b=mnq X+fc6vHgoHDOAP1pkEDDJ43prYbRtyRftbl+J7VDMlbaX8qXyvPfMR1lslaT9Tqu Lx27rp/MAhu6IbbLTPGzjdwhoinL2A76ERZ6AZdP9g65z89vSGmLcoBTEIbl6vFo RIcISAYuljwQRUuXZBHh1TU67Mihfa3IO+sq8rQc= Received: (qmail 49406 invoked by alias); 6 Jan 2019 10:33:02 -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 49333 invoked by uid 89); 6 Jan 2019 10:33:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=UD:builtin-convertvector-1.c X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 06 Jan 2019 10:33:00 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 42E737F6C7; Sun, 6 Jan 2019 10:32:59 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-18.ams2.redhat.com [10.36.116.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B82235D75F; Sun, 6 Jan 2019 10:32:58 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x06AWuol001691; Sun, 6 Jan 2019 11:32:57 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x06AWtL5001690; Sun, 6 Jan 2019 11:32:55 +0100 Date: Sun, 6 Jan 2019 11:32:55 +0100 From: Jakub Jelinek To: Uros Bizjak Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Add vec_extract{v32qiv16qi, v16hiv8hi, v8siv4si, v4div2di, v8sfv4sf, v4dfv2df} Message-ID: <20190106103255.GJ30353@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi! Looking at the output of builtin-convertvector-1.c (f4), this patch changes the generated code: vcvttpd2dqy (%rdi), %xmm0 - vmovdqa %xmm0, %xmm0 vmovaps %xmm0, (%rsi) - vzeroupper ret The problem is that without vec_extract patterns to extract 128-bit vectors from 256-bit ones, the expander creates TImode extraction and combine + simplify-rtx.c isn't able to optimize it out properly due to vector -> non-vector -> vector mode subregs in there. We already have vec_extract patterns to extract 256-bit vectors from 512-bit ones and we have all the vec_extract_{lo,hi}_* named insns even for the 128-bit out of 256-bit vectors, so this patch just makes those available to the expander. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2019-01-06 Jakub Jelinek * config/i386/sse.md (vec_extract): Use V_256_512 iterator instead of V_512 and TARGET_AVX instead of TARGET_AVX512F as condition. Jakub --- gcc/config/i386/sse.md.jj 2019-01-04 09:56:08.548495229 +0100 +++ gcc/config/i386/sse.md 2019-01-05 21:33:34.057288059 +0100 @@ -8362,9 +8362,9 @@ (define_expand "vec_extract" [(match_operand: 0 "nonimmediate_operand") - (match_operand:V_512 1 "register_operand") + (match_operand:V_256_512 1 "register_operand") (match_operand 2 "const_0_to_1_operand")] - "TARGET_AVX512F" + "TARGET_AVX" { if (INTVAL (operands[2])) emit_insn (gen_vec_extract_hi_ (operands[0], operands[1]));