From patchwork Thu Feb 14 12:30:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1042084 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-496108-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (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="pi7uVfAB"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="knUDJ8tb"; 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 440bW845c3z9rxp for ; Thu, 14 Feb 2019 23:37:03 +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:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; q=dns; s=default; b=n7Y fR0kXvB3Yz/4olfqqKYdOyYHTOKXx0KZvMjeX0IiVKIBYyfr3LsXOa/HVWmotSDV K/gEyxE/gfy1bcLjy8gOjsFaO3VXHsBsvmoo4k26RrwsfCDVq9vEFvwYje+7L98b Rxt/q1vJtI+J5D3OhwFiuE9vYY9YxZgqwm240wlw= 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:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=default; bh=Y09ygKiZp 3MDnY61MnZ1wWu+7iM=; b=pi7uVfAB8V/WmXtlwvEjd+TIWrHeWJ+GvHptI9g4p 5ZyMsTVTlyaZ0ECfqM3dbUbVIAACqmJK9LseOEACViq9S8fE48OAV+4URsB4BBeB 0JvVcTsqVdPtLynMjXr/XOa9ooIwx8GrC1jSqIFkeE/8XVTIUzLrCNaygJCyIg/c y0= Received: (qmail 17965 invoked by alias); 14 Feb 2019 12:33: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 17872 invoked by uid 89); 14 Feb 2019 12:33:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: mail-pg1-f172.google.com Received: from mail-pg1-f172.google.com (HELO mail-pg1-f172.google.com) (209.85.215.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Feb 2019 12:33:06 +0000 Received: by mail-pg1-f172.google.com with SMTP id v28so3005358pgk.10 for ; Thu, 14 Feb 2019 04:33:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4GeZVBCsj+YnwTg64gky8RzeeL6KlxCEX6h5sgmLWlI=; b=knUDJ8tbedlAOS1psnJIFEbLDoyiATk2juncdHngIv3IVRSF1x1AXg0TXIWg1eh4QY FeZnDJnFtfhpBRCi5aS/kq7qD1xqJt7CnsBlWmviQy8P2E3VtcuwQm5k8yWLiPM5klVu 6xtfQXGK5/g6WWHqid7eHOKsY75g79tvEUvIzXsV7SXTOkGvBWAGCg65KMgq7EW7E/SP eVykPSvUGVCQvFnEOH52VpmSUmlfiRhrYAYqoqcf6jxs96xF2YLJ+tzfEKYOHRjwrLZg tqUCQg6jQfV8pjqDf8uMHX9F+iBQBMc40uwWlxLPWHZrAnPUPtUJxkRKoYRV6jyj5V1q REXw== Received: from gnu-cfl-2.localdomain (c-73-93-86-59.hsd1.ca.comcast.net. [73.93.86.59]) by smtp.gmail.com with ESMTPSA id p20sm5558946pfi.152.2019.02.14.04.33.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Feb 2019 04:33:03 -0800 (PST) Received: from gnu-cfl-2.hsd1.ca.comcast.net (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id A9A26C0355; Thu, 14 Feb 2019 04:30:33 -0800 (PST) From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: Uros Bizjak Subject: [PATCH 24/40] i386: Emulate MMX mmx_psadbw with SSE Date: Thu, 14 Feb 2019 04:30:15 -0800 Message-Id: <20190214123031.13301-25-hjl.tools@gmail.com> In-Reply-To: <20190214123031.13301-1-hjl.tools@gmail.com> References: <20190214123031.13301-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes Emulate MMX mmx_psadbw with SSE. Only SSE register source operand is allowed. PR target/89021 * config/i386/mmx.md (mmx_psadbw): Add SSE emulation. --- gcc/config/i386/mmx.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index e1432edcd3d..0c08aebb071 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -1782,14 +1782,19 @@ (set_attr "mode" "DI,TI,TI")]) (define_insn "mmx_psadbw" - [(set (match_operand:V1DI 0 "register_operand" "=y") - (unspec:V1DI [(match_operand:V8QI 1 "register_operand" "0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")] + [(set (match_operand:V1DI 0 "register_operand" "=y,x,Yv") + (unspec:V1DI [(match_operand:V8QI 1 "register_operand" "0,0,Yv") + (match_operand:V8QI 2 "nonimmediate_operand" "ym,x,Yv")] UNSPEC_PSADBW))] - "TARGET_SSE || TARGET_3DNOW_A" - "psadbw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) + "(TARGET_MMX || TARGET_MMX_WITH_SSE) + && (TARGET_SSE || TARGET_3DNOW_A)" + "@ + psadbw\t{%2, %0|%0, %2} + psadbw\t{%2, %0|%0, %2} + vpsadbw\t{%2, %1, %0|%0, %1, %2}" + [(set_attr "mmx_isa" "native,x64_noavx,x64_avx") + (set_attr "type" "mmxshft,sseiadd,sseiadd") + (set_attr "mode" "DI,TI,TI")]) (define_insn_and_split "mmx_pmovmskb" [(set (match_operand:SI 0 "register_operand" "=r,r")