From patchwork Fri Jan 7 19:43:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1576852 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=SXhH4aV9; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4JVtvx1x0Zz9s1l for ; Sat, 8 Jan 2022 06:44:29 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F22DD3857C59 for ; Fri, 7 Jan 2022 19:44:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F22DD3857C59 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1641584666; bh=RA0TkJCTh+YRloTEtB84c212aiTjNCvEcuB7N2sZPBA=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=SXhH4aV9dToDpTwodxhHJuFjw0L/tqlV6I1irA+f4uVOliRcVJuiLEw/vR0kxnCzy mFYeGmG0uJUP9U5eLcENW1dKcDvSM4BX5YGnZv9gff/oDOAWb2tWwgxCEVtuc0q4dh 5HIQymQoOHUUPWbjf/fHlM2gkt83ByAmdP3/qvmM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by sourceware.org (Postfix) with ESMTPS id 7FFB93858D28 for ; Fri, 7 Jan 2022 19:43:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7FFB93858D28 Received: by mail-qk1-x730.google.com with SMTP id 131so6994808qkk.2 for ; Fri, 07 Jan 2022 11:43:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=RA0TkJCTh+YRloTEtB84c212aiTjNCvEcuB7N2sZPBA=; b=fDbbTtz2lMep8xBbZQTUxFL9c1dfBwHyxkrL8la7JX31hfT3tocR+x8DVJtOXbuiYA yJYs+x5bKB55ntwO9efGs/QOAqZXCQ6GWe7FE7h5Xvf/OTHRsTRaGVlzjmtBgf6kLL/C NLdEVj8nZUcfojAtz1xd9ldVdjwBa1rmeB1G8ql6sbkdqu+dUmjPy4/sdQe+91Ft4BzP OWU9CS2sxm3M6Z2kOyEf/e5TNKjXCJwSvPTU1JLj3bzmbUWwTHnueC09wSFhq6arMuLq GMHqVsBGi8jiDXKUey4odyCCLb4N98+3UlfakKUtL5utcCjI+3bU5QsmCh1SQzVONnd+ 5KOw== X-Gm-Message-State: AOAM533vMvKfdu/yAHJ9+olFb0IB1CwJdx+e1ffeMVpi3kXUrskGCZPU g18lwIq0W2UZcpVORV77qAuOkt5DUKb42xNeZ6DGahBO2Hvq4w== X-Google-Smtp-Source: ABdhPJyaoOCSycjrSBndWDGcQH0i/Mu0M3E84LByNl119mrfzHk9rtHsa/6gOCV08R+Z7V+T+OttaaaazOgzXX7q5Gk= X-Received: by 2002:a05:620a:2486:: with SMTP id i6mr46049721qkn.522.1641584624754; Fri, 07 Jan 2022 11:43:44 -0800 (PST) MIME-Version: 1.0 Date: Fri, 7 Jan 2022 20:43:33 +0100 Message-ID: Subject: [PATCH] i386: Robustify V2QI and V4QI move patterns To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Uros Bizjak via Gcc-patches From: Uros Bizjak Reply-To: Uros Bizjak Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Add sse2 isa attribute where needed and remove where not needed. 2022-01-07 Uroš Bizjak gcc/ChangeLog: * config/i386/mmx.md (*move_internal): Add isa attribute. (*movv2qi_internal): Remve sse2 requirement for alternatives 4,5. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Pushed to master. Uros. diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index 8e0a6490b7b..4fc3e00f100 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -285,7 +285,12 @@ gcc_unreachable (); } } - [(set (attr "type") + [(set (attr "isa") + (cond [(eq_attr "alternative" "6,7") + (const_string "sse2") + ] + (const_string "*"))) + (set (attr "type") (cond [(eq_attr "alternative" "2") (const_string "sselog1") (eq_attr "alternative" "3,4,5,6,7") @@ -306,12 +311,15 @@ (const_string "V4SF") (match_test "TARGET_AVX") (const_string "TI") - (match_test "optimize_function_for_size_p (cfun)") + (ior (not (match_test "TARGET_SSE2")) + (match_test "optimize_function_for_size_p (cfun)")) (const_string "V4SF") ] (const_string "TI")) + (and (eq_attr "alternative" "4,5") - (match_test "mode == V2HFmode")) + (ior (match_test "mode == V2HFmode") + (not (match_test "TARGET_SSE2")))) (const_string "SF") ] (const_string "SI"))) @@ -401,7 +409,7 @@ } } [(set (attr "isa") - (cond [(eq_attr "alternative" "4,5,6,8,9") + (cond [(eq_attr "alternative" "6,8,9") (const_string "sse2") (eq_attr "alternative" "7") (const_string "sse4")