From patchwork Fri May 7 07:57:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1475380 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=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=o4hGBOQe; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fc2q10h4Dz9rx6 for ; Fri, 7 May 2021 17:57:17 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D9FC03857818; Fri, 7 May 2021 07:57:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9FC03857818 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1620374234; bh=Wnq3VpEYjshzQznVXAOvnhdb/JzFDwmqji46tCEFFhI=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=o4hGBOQeJ7q3GkMzveSdF/VB4+016uAaM2+zsPtszsbB9ZYOLfJT6sB0+IB5b9hGa RQ55Nm+I3D3gMXfIf0icuGmXzIgrPtoPooYHXMtbG6AlHsdUx8PDS0W97pWPgtBtfb lQefkpuHEBLFJv2dqWZubAKo0br4/xRQbiknGQwY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 1BCDB3857C66 for ; Fri, 7 May 2021 07:57:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1BCDB3857C66 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-466-uvK1PfCHM1CKC-ROiwCbsA-1; Fri, 07 May 2021 03:57:10 -0400 X-MC-Unique: uvK1PfCHM1CKC-ROiwCbsA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A5931E586; Fri, 7 May 2021 07:57:10 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-114-59.ams2.redhat.com [10.36.114.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AC0D919C66; Fri, 7 May 2021 07:57:09 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 1477v7HS2655888 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 7 May 2021 09:57:07 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 1477v7Cx2655887; Fri, 7 May 2021 09:57:07 +0200 Date: Fri, 7 May 2021 09:57:06 +0200 To: Uros Bizjak Subject: [PATCH] i386: Fix up 8-byte vcond* with -mxop [PR100445] Message-ID: <20210507075706.GH1179226@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi! ix86_expand_sse_movcc has special TARGET_XOP handling and the recent addition of support of v*cond* patterns for MMXMODEI modes results in ICEs because the expected pattern doesn't exist. We can handle it using 128-bit vpcmov (if we ignore the upper 64 bits like we ignore in other TARGET_MMX_WITH_SSE support). Bootstrapped/regtested on x86_64-linux and i686-linux (admittedly on a CPU without XOP support), ok for trunk? 2021-05-07 Jakub Jelinek PR target/100445 * config/i386/mmx.md (*xop_pcmov_): New define_insn. * gcc.target/i386/pr100445.c: New test. Jakub --- gcc/config/i386/mmx.md.jj 2021-05-06 10:14:55.508063058 +0200 +++ gcc/config/i386/mmx.md 2021-05-06 14:43:19.731486156 +0200 @@ -1700,6 +1700,17 @@ (define_expand "vcond_mask_" DONE; }) +;; XOP parallel XMM conditional moves +(define_insn "*xop_pcmov_" + [(set (match_operand:MMXMODEI 0 "register_operand" "=x") + (if_then_else:MMXMODEI + (match_operand:MMXMODEI 3 "register_operand" "x") + (match_operand:MMXMODEI 1 "register_operand" "x") + (match_operand:MMXMODEI 2 "register_operand" "x")))] + "TARGET_XOP && TARGET_MMX_WITH_SSE" + "vpcmov\t{%3, %2, %1, %0|%0, %1, %2, %3}" + [(set_attr "type" "sse4arg")]) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Parallel integral logical operations --- gcc/testsuite/gcc.target/i386/pr100445.c.jj 2021-05-06 14:46:35.936327593 +0200 +++ gcc/testsuite/gcc.target/i386/pr100445.c 2021-05-06 14:46:10.259609909 +0200 @@ -0,0 +1,12 @@ +/* PR target/100445 */ +/* { dg-do compile } */ +/* { dg-options "-O3 -mxop" } */ + +int a, b[3]; + +void +foo (void) +{ + for (; a < 3; a++) + b[a] = (a - 1) / 2; +}