From patchwork Thu Jun 27 08:59:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 1123194 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-503856-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="silNyTLJ"; 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 45ZDP54hsxz9sCJ for ; Thu, 27 Jun 2019 18:59:52 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:to:cc:subject:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=rbu9zvPwYSN++e9L T4gqPRZdZE34rjf0y/1nXauAxNXc6kt5YRk3NorATRQ0ZDBokDMOUPSrAIgide75 QQ/yduNAC+pl0kLFhjAcNmJofF/AAOMxl8oRhIxxWHk+X5yEZ97z2uH48M4ej48M 3vtLmCyeLeaEdzatSxNHJ3KEQiA= 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 :message-id:date:from:to:cc:subject:mime-version:content-type :content-transfer-encoding; s=default; bh=+lJi0/V+9k7MRFCEEUguLR 9bvbU=; b=silNyTLJMVvGHNQGarJAdtPzZocNu41iubufe8wLme4JPsCtN1FGZ8 iCjVC5iS/x9JcR4ie+vfhML9jFlyt7/cA/xMYzfLwyhozBVsLefFoGb3ruBs5EkG B5CquXkozuPN90UDUiujPP70qcp3PnCXRBjkqMuGfyR+rrA67QzJY= Received: (qmail 91041 invoked by alias); 27 Jun 2019 08:59:45 -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 91032 invoked by uid 89); 27 Jun 2019 08:59:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=au, AU, HX-Languages-Length:1912 X-HELO: prv1-mh.provo.novell.com Received: from prv1-mh.provo.novell.com (HELO prv1-mh.provo.novell.com) (137.65.248.33) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Jun 2019 08:59:44 +0000 Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Thu, 27 Jun 2019 02:59:43 -0600 Message-Id: <5D14857D020000780023B740@prv1-mh.provo.novell.com> Date: Thu, 27 Jun 2019 02:59:41 -0600 From: "Jan Beulich" To: Cc: "Kirill Yukhin" , , Subject: [PATCH] x86/AVX512: improve generated code for mask-to-vector-register conversions Mime-Version: 1.0 Content-Disposition: inline Conversion of comparison results to full vectors does, when VPMOVM2* are unavailable, not require any intermediate VMOVDQ{A,U}*: Simply use embedded masking on VPTERNLOG* right away, which is available with AVX512F (while VPMOVM2{D,Q} are available only with AVX512DQ). Note that the chosen immediate is only one of many possible ones; I was trying to make the insn here distinguishable from the pre-existing uses of vpternlog. gcc/ 2019-06-27 Jan Beulich * config/i386/sse.md (_cvtmask2): Require only AVX512F. (*_cvtmask2): Likewise. Add alternative expanding to vpternlog. --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -6395,21 +6395,25 @@ (match_dup 2) (match_dup 3) (match_operand: 1 "register_operand")))] - "TARGET_AVX512DQ" + "TARGET_AVX512F" "{ operands[2] = CONSTM1_RTX (mode); operands[3] = CONST0_RTX (mode); }") (define_insn "*_cvtmask2" - [(set (match_operand:VI48_AVX512VL 0 "register_operand" "=v") + [(set (match_operand:VI48_AVX512VL 0 "register_operand" "=v,v") (vec_merge:VI48_AVX512VL (match_operand:VI48_AVX512VL 2 "vector_all_ones_operand") (match_operand:VI48_AVX512VL 3 "const0_operand") - (match_operand: 1 "register_operand" "k")))] - "TARGET_AVX512DQ" - "vpmovm2\t{%1, %0|%0, %1}" - [(set_attr "prefix" "evex") + (match_operand: 1 "register_operand" "k,Yk")))] + "TARGET_AVX512F" + "@ + vpmovm2\t{%1, %0|%0, %1} + vpternlog\t{$0x81, %0, %0, %0%{%1%}%{z%}|%0%{%1%}%{z%}, %0, %0, 0x81}" + [(set_attr "isa" "avx512dq,*") + (set_attr "length_immediate" "0,1") + (set_attr "prefix" "evex") (set_attr "mode" "")]) (define_insn "sse2_cvtps2pd"