From patchwork Sun Feb 10 00:19:18 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: 1039330 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-495662-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="W6szoMhe"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="o4TOzyUj"; 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 43xqPN5qZ7z9sML for ; Sun, 10 Feb 2019 11:22:32 +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=h6A SQG8dURM2ByljMudNIIE/0hu5PoBSjjZCYB5gzqDStlbMVByNMvQ0nkJeXHDYguu Fxzkb3hbHsn7gmg0WlhFjq4XIidOSY3hOKG1Lmdraaq4zIDwQ67DkIjwV7PheD2s pL7wtIRcCc7nS9f1fFVo+7qOWvNjA+go2EYcc7ys= 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=UAOSp+Jp9 aW2SHUkE5LMM7OxfZo=; b=W6szoMheWipWSRVQ+qeRZS8pbcvjgDnMoica8WfxL 0Lh7rqyPuJeHQnFeuyUCggWOQsjamcRYf05+cxYzhns3gJZc8FRZUVqx/x/4zJ/s EHZFVswAvChEfXvZGZx+vGf7xNJ52Mo4nhgLcE6CR5olPoq63zWdYXFI946rkegI yo= Received: (qmail 123166 invoked by alias); 10 Feb 2019 00:20: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 122052 invoked by uid 89); 10 Feb 2019 00:20:00 -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=HX-Google-DKIM-Signature:VXA, HContent-Transfer-Encoding:8bit X-HELO: mail-pg1-f171.google.com Received: from mail-pg1-f171.google.com (HELO mail-pg1-f171.google.com) (209.85.215.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 10 Feb 2019 00:19:59 +0000 Received: by mail-pg1-f171.google.com with SMTP id y1so3230565pgk.11 for ; Sat, 09 Feb 2019 16:19:59 -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=wvu10PzwFMnd4Asig5y9Ui0Ymil7fxuCeCIr/JdqP6E=; b=o4TOzyUjYDOKsYfUjcXpej6Ino3EitFfdADDUxIa8Feiwt6M3ZyvPaUyaHA7ZO8YFr 9gjqUnm52pFZpoz3iJ70dSaEAtsGUUWSdKULgBlp5P3vRNJRX+Cebh9Pj283QYB8bWu5 N2y2sSriFTZqPGGaByYk1BTcjVR6emP9artweztz1dTwvR9xCGW9PQ/qvDK5D0E2XJ0X LgyMTnJmnVRUNLc4x3dTDIzOpjo3NlhLUuMvexYwKy9EcCaELKMZP3dyadbNv2574vM3 1+G8+ucz4ZzAh9ofFza0dDSsIIr6/MX58QrVbictPRiG8Hp5t+h9E2GdFh9vQKP0lKiM CDWA== 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 f6sm10325153pfc.88.2019.02.09.16.19.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Feb 2019 16:19:56 -0800 (PST) Received: from gnu-cfl-2.hsd1.ca.comcast.net (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id 6692BC0337; Sat, 9 Feb 2019 16:19:48 -0800 (PST) From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: Uros Bizjak Subject: [PATCH 14/43] i386: Emulate MMX sse_cvtps2pi/sse_cvttps2pi with SSE Date: Sat, 9 Feb 2019 16:19:18 -0800 Message-Id: <20190210001947.27278-15-hjl.tools@gmail.com> In-Reply-To: <20190210001947.27278-1-hjl.tools@gmail.com> References: <20190210001947.27278-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes Emulate MMX sse_cvtps2pi/sse_cvttps2pi with SSE. PR target/89021 * config/i386/mmx.md (sse_cvtps2pi): Add SSE emulation. (sse_cvttps2pi): Likewise. --- gcc/config/i386/sse.md | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 7d2c0367911..ad31ac3d9e6 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -4668,26 +4668,32 @@ (set_attr "mode" "V4SF")]) (define_insn "sse_cvtps2pi" - [(set (match_operand:V2SI 0 "register_operand" "=y") + [(set (match_operand:V2SI 0 "register_operand" "=y,Yv") (vec_select:V2SI - (unspec:V4SI [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] + (unspec:V4SI [(match_operand:V4SF 1 "nonimmediate_operand" "xm,YvBm")] UNSPEC_FIX_NOTRUNC) (parallel [(const_int 0) (const_int 1)])))] - "TARGET_SSE" - "cvtps2pi\t{%1, %0|%0, %q1}" - [(set_attr "type" "ssecvt") - (set_attr "unit" "mmx") + "(TARGET_MMX || TARGET_MMX_WITH_SSE) && TARGET_SSE" + "@ + cvtps2pi\t{%1, %0|%0, %q1} + %vcvtps2dq\t{%1, %0|%0, %1}" + [(set_attr "mmx_isa" "native,x64") + (set_attr "type" "ssecvt") + (set_attr "unit" "mmx,*") (set_attr "mode" "DI")]) (define_insn "sse_cvttps2pi" - [(set (match_operand:V2SI 0 "register_operand" "=y") + [(set (match_operand:V2SI 0 "register_operand" "=y,Yv") (vec_select:V2SI - (fix:V4SI (match_operand:V4SF 1 "nonimmediate_operand" "xm")) + (fix:V4SI (match_operand:V4SF 1 "nonimmediate_operand" "xm,YvBm")) (parallel [(const_int 0) (const_int 1)])))] - "TARGET_SSE" - "cvttps2pi\t{%1, %0|%0, %q1}" - [(set_attr "type" "ssecvt") - (set_attr "unit" "mmx") + "(TARGET_MMX || TARGET_MMX_WITH_SSE) && TARGET_SSE" + "@ + cvttps2pi\t{%1, %0|%0, %q1} + %vcvttps2dq\t{%1, %0|%0, %1}" + [(set_attr "mmx_isa" "native,x64") + (set_attr "type" "ssecvt") + (set_attr "unit" "mmx,*") (set_attr "prefix_rep" "0") (set_attr "mode" "SF")])