From patchwork Wed Dec 2 13:51:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 551378 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 905591402ED for ; Thu, 3 Dec 2015 00:53:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ap+vqkXH; 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:subject:message-id:mime-version:content-type; q=dns; s= default; b=nOnMzCaN/6YPk6oeeMZbTPivimnGjz6TcZ3FWnI81Gp8sANTejRCw M28uVeMrBMG5tVRwA83QR2gGIMpzjjkJV4iDWJqEoMacuDSLQrBHNxIC+u9JxXeA XK1KwslILCCl9sPTPUP1xos/9LGRtHOK7GLRTeDm/E61oM00YrG4Bo= 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:subject:message-id:mime-version:content-type; s= default; bh=rErlZlv4yisJJnN++MDpNw9QoOU=; b=ap+vqkXHQ497UEUbJMdh wEPf+YtbHGWHU90PZTgXBS3Ol/mM2R0ASQTzvFoIptSxzGMW+iuVGGFOKCt9en0b emvrYjSpGlPYtSIQcRgp7bCME2rkTkslh2bdQ47Ww3Q5c9/q/CDWnWViBKxluNmd HpRYzRDnLBv0wl7/CyOHVxs= Received: (qmail 131027 invoked by alias); 2 Dec 2015 13:53:04 -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 129233 invoked by uid 89); 2 Dec 2015 13:53:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=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; Wed, 02 Dec 2015 13:53:01 +0000 Received: by iouu10 with SMTP id u10so46837910iou.0 for ; Wed, 02 Dec 2015 05:52:59 -0800 (PST) X-Received: by 10.107.4.213 with SMTP id 204mr4195368ioe.195.1449064379033; Wed, 02 Dec 2015 05:52:59 -0800 (PST) Received: from msticlxl57.ims.intel.com (irdmzpr01-ext.ir.intel.com. [192.198.151.36]) by smtp.gmail.com with ESMTPSA id xo8sm11267960igb.13.2015.12.02.05.52.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Dec 2015 05:52:58 -0800 (PST) Date: Wed, 2 Dec 2015 16:51:54 +0300 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, i386] Fix alignment check for AVX-512 masked store Message-ID: <20151202135154.GA4176@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi, This patch fixes wrong alignment check in _store_mask pattern. Currently we check a register operand instead of a memory one. This fixes segfault on 481.wrf compiled at -O3 for KNL target. I bootstrapped and tested this patch on x86_64-unknown-linux-gnu. I got a bunch of new failures: FAIL: gcc.target/i386/avx512vl-vmovapd-1.c scan-assembler-times vmovapd[ \\t]+[^{\n]*%xmm[0-9]+[^\n]*\\){%k[1-7]}(?:\n|[ \\t]+#) 1 FAIL: gcc.target/i386/avx512vl-vmovapd-1.c scan-assembler-times vmovapd[ \\t]+[^{\n]*%xmm[0-9]+[^\n]*\\){%k[1-7]}(?:\n|[ \\t]+#) 1 FAIL: gcc.target/i386/avx512vl-vmovapd-1.c scan-assembler-times vmovapd[ \\t]+[^{\n]*%ymm[0-9]+[^\n]*\\){%k[1-7]}(?:\n|[ \\t]+#) 1 FAIL: gcc.target/i386/avx512vl-vmovapd-1.c scan-assembler-times vmovapd[ \\t]+[^{\n]*%ymm[0-9]+[^\n]*\\){%k[1-7]}(?:\n|[ \\t]+#) 1 FAIL: gcc.target/i386/avx512vl-vmovaps-1.c scan-assembler-times vmovaps[ \\t]+[^{\n]*%xmm[0-9]+[^\n]*\\){%k[1-7]}(?:\n|[ \\t]+#) 1 FAIL: gcc.target/i386/avx512vl-vmovaps-1.c scan-assembler-times vmovaps[ \\t]+[^{\n]*%xmm[0-9]+[^\n]*\\){%k[1-7]}(?:\n|[ \\t]+#) 1 FAIL: gcc.target/i386/avx512vl-vmovaps-1.c scan-assembler-times vmovaps[ \\t]+[^{\n]*%ymm[0-9]+[^\n]*\\){%k[1-7]}(?:\n|[ \\t]+#) 1 FAIL: gcc.target/i386/avx512vl-vmovaps-1.c scan-assembler-times vmovaps[ \\t]+[^{\n]*%ymm[0-9]+[^\n]*\\){%k[1-7]}(?:\n|[ \\t]+#) 1 With patch applied test generates vmovup[sd] because memory references don't have proper alignment set. Since this is another bug and it's actually a performance one, I think this patch should go to trunk. Thanks, Ilya --- gcc/ 2015-12-02 Ilya Enkovich * config/i386/sse.md (_store_mask): Fix operand checked for alignment. diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index e7b517a..d65ed0c 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -1051,7 +1051,7 @@ sse_suffix = ""; } - if (misaligned_operand (operands[1], mode)) + if (misaligned_operand (operands[0], mode)) align = "u"; else align = "a";