From patchwork Tue Dec 10 05:47:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongtao Liu X-Patchwork-Id: 1206916 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515569-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="EFDjs9JG"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="p7p0SIRC"; 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 47X8Bp2W20z9sPh for ; Tue, 10 Dec 2019 16:44:16 +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 :mime-version:from:date:message-id:subject:to:cc:content-type; q=dns; s=default; b=XFP0yh8C3mYuB7PXGnBoCk5PwbCfGcNdQKZ7vbhHCJv EBdYcAfAXZC4+NbTCm5r0BA6FKXl1BgoU4m/rxv7igm0/Mr7jmqayH5sQ3rp51EH RGkiP/RI6PikI/01Lg4SW+m9N5lUbJrkpzeeqMtcUyfQ2Evp4mHHHEcHF1Gk3EjA = 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 :mime-version:from:date:message-id:subject:to:cc:content-type; s=default; bh=b+Q2aiA8+nHe6FjnL3ZHjqePYTY=; b=EFDjs9JGT/sawAaIw eExPIInSqfJxTZUWTWAB/yWOV6PSmVPXCstfFevleKFTrPvmjif8nFtvbi5Fudu3 TpZmVWAZbmxcH+OY3j19dmQgcFWUoNr9vCmrM+eEL4V56XMOX+WLD2uql84qvoN1 a3spNg2wgZbbI3E5ScHWZN12X4= Received: (qmail 82963 invoked by alias); 10 Dec 2019 05:44:08 -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 82953 invoked by uid 89); 10 Dec 2019 05:44:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, MIME_BOUND_DIGITS_15, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=vpcmpu, bwdq, vpcmp, vmovdq X-HELO: mail-oi1-f173.google.com Received: from mail-oi1-f173.google.com (HELO mail-oi1-f173.google.com) (209.85.167.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Dec 2019 05:44:06 +0000 Received: by mail-oi1-f173.google.com with SMTP id c16so8740692oic.3 for ; Mon, 09 Dec 2019 21:44:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=XOAukSxsP+4zsqcKM8IGHTcIBoBPbTn3DWS6++gyoHg=; b=p7p0SIRCsHshDBq2xeyQdOsTeCjDgxTeIVs6y7DyOgvtD67GVTLwxrim7Hz49nkja4 cyRIOPckHKKnlLOCOSY+Em95WMgtAqawfGfArSeYGOkV3OjGLNLzCdooyTgXAIADY/tC 5cCOvZ7TTmmLq7lKm0upjwFyTk8hkD+wvQrMgypiKDyARc+fpLWsI2jUKMnl0/k6Zmy8 /7bEmJkP8IiO3sEBfOaHEL2EJQrW7pIGh78z5IfDUefIIUyx03lm/Y9hmQx1GulOJ0WT 79irULGQKVHLpQOQVQL7ofVINm9IDPQZRxB7dGYzTkokntVpBkH4YyOX3uksp8ukgW26 kNLA== MIME-Version: 1.0 From: Hongtao Liu Date: Tue, 10 Dec 2019 13:47:50 +0800 Message-ID: Subject: [PATCH] Fix unrecognizable insn of pr92865 To: Jakub Jelinek , GCC Patches Cc: "H. J. Lu" , wwwhhhyyy333@gmail.com, Richard Biener X-IsSubscribed: yes Hi jakub: This patch is to enable integer mask cmp/cmov under AVX512F even with TARGET_XOP . Bootstrap and regression test on i386/x86_64 backend is ok. Changelog: PR target/92865 * gcc/config/i386/i386-expand.c (ix86_valid_mask_cmp_mode): Enable integer mask cmov when available even with TARGET_XOP. * gcc/testsuite/gcc.target/i386/pr92865-1.c: New test. From 2c53eb1ddf876a616c7ee914256e3a27f30cd158 Mon Sep 17 00:00:00 2001 From: liuhongt Date: Tue, 10 Dec 2019 09:44:18 +0800 Subject: [PATCH] Fix unrecognizable insn of pr92865. PR target/92865 * gcc/config/i386/i386-expand.c (ix86_valid_mask_cmp_mode): Enable integer mask cmov when available even with TARGET_XOP. * gcc/testsuite/gcc.target/i386/pr92865-1.c: New test. --- gcc/config/i386/i386-expand.c | 2 +- gcc/testsuite/gcc.target/i386/pr92865-1.c | 67 +++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr92865-1.c diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c index ff3c24cc5b7..cbf4eb7b487 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c @@ -3428,7 +3428,7 @@ static bool ix86_valid_mask_cmp_mode (machine_mode mode) { /* XOP has its own vector conditional movement. */ - if (TARGET_XOP) + if (TARGET_XOP && !TARGET_AVX512F) return false; /* AVX512F is needed for mask operation. */ diff --git a/gcc/testsuite/gcc.target/i386/pr92865-1.c b/gcc/testsuite/gcc.target/i386/pr92865-1.c new file mode 100644 index 00000000000..49b5778a067 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr92865-1.c @@ -0,0 +1,67 @@ +/* PR target/92865 */ +/* { dg-do compile } */ +/* { dg-options "-Ofast -mavx512f -mavx512bw -mxop" } */ +/* { dg-final { scan-assembler-times "vpcmp\[bwdq\]\[\t ]" 4 } } */ +/* { dg-final { scan-assembler-times "vpcmpu\[bwdq\]\[\t ]" 4 } } */ +/* { dg-final { scan-assembler-times "vmovdq\[au\]8\[\t ]" 4 } } */ +/* { dg-final { scan-assembler-times "vmovdq\[au\]16\[\t ]" 4 } } * +/* { dg-final { scan-assembler-times "vmovdq\[au\]32\[\t ]" 4 } } */ +/* { dg-final { scan-assembler-times "vmovdq\[au\]64\[\t ]" 4 } } */ + +extern char arraysb[64]; +extern short arraysw[32]; +extern int arraysd[16]; +extern long long arraysq[8]; + +extern unsigned char arrayub[64]; +extern unsigned short arrayuw[32]; +extern unsigned int arrayud[16]; +extern unsigned long long arrayuq[8]; + +int f1(char a) +{ + for (int i = 0; i < 64; i++) + arraysb[i] = arraysb[i] >= a; +} + +int f2(short a) +{ + for (int i = 0; i < 32; i++) + arraysw[i] = arraysw[i] >= a; +} + +int f3(int a) +{ + for (int i = 0; i < 16; i++) + arraysd[i] = arraysd[i] >= a; +} + +int f4(long long a) +{ + for (int i = 0; i < 8; i++) + arraysq[i] = arraysq[i] >= a; +} + +int f5(unsigned char a) +{ + for (int i = 0; i < 64; i++) + arrayub[i] = arrayub[i] >= a; +} + +int f6(unsigned short a) +{ + for (int i = 0; i < 32; i++) + arrayuw[i] = arrayuw[i] >= a; +} + +int f7(unsigned int a) +{ + for (int i = 0; i < 16; i++) + arrayud[i] = arrayud[i] >= a; +} + +int f8(unsigned long long a) +{ + for (int i = 0; i < 8; i++) + arrayuq[i] = arrayuq[i] >= a; +} -- 2.18.1