From patchwork Mon Nov 26 17:36:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrill Tkachov X-Patchwork-Id: 1003347 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-490894-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=foss.arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="UG4yEubM"; 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 433YyX2k4Qz9ryk for ; Tue, 27 Nov 2018 04:37:24 +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 :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=oO2OITpjFokVUhrqvvoEfOlcbsl8QTS0I7HZtWKC984 aRyaGz0H3IXKBkaiNR7KoiDJRtaDRQUmG0XIEmwCt6Xc2ijY0PxLJcAC9HIRPhIE FSElv27WpJrQ0YhXsybnvSsbtcJYb7RWQsaOLQE/6ztUnxR7Ncc3KOczGKLYpjVQ = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=9hwRge/D7qMjFieXenfQQXT9f9Q=; b=UG4yEubMpFYXpAhSi 1JRzoyLBnAj+l2eikzwvW5ycHvNfStHHHoHqdxM40w2N0ZAdChRbqs9S9dYtumhP xy9uDfiCwD9Cok6vhbaSTQ8b5kJJ7ja89OeukU7Aln08WkGG86czsQl2euPQe+fL ga5YRjP2hN0ga8YzSkAQpbtaTI= Received: (qmail 126753 invoked by alias); 26 Nov 2018 17:36:53 -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 126670 invoked by uid 89); 26 Nov 2018 17:36:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy= X-HELO: foss.arm.com Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Nov 2018 17:36:47 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D516F1A25; Mon, 26 Nov 2018 09:36:45 -0800 (PST) Received: from [10.2.207.77] (e100706-lin.cambridge.arm.com [10.2.207.77]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 176F93F5AF; Mon, 26 Nov 2018 09:36:44 -0800 (PST) Message-ID: <5BFC2F2B.3050102@foss.arm.com> Date: Mon, 26 Nov 2018 17:36:43 +0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Marcus Shawcroft , "Richard Earnshaw (lists)" , James Greenhalgh Subject: [PATCH][AArch64][2/3] Correct type attribute for mul and mneg instructions Hi all, In the AAarch64 ISA the MUL and MNEG instructions are actually aliases of MADD and MSUB. Therefore they should have the type attribute mla, rather than mul, which should only be used for AArch32 32-bit multiplication instructions. This will ensure more consistent scheduling decisions. Bootstrapped and tested on aarch64-none-linux-gnu. Ok for trunk? Thanks, Kyrill 2018-11-26 Kyrylo Tkachov * config/aarch64/aarch64.md (mul3): Change type to mla. (*mulsi3_uxtw): Likewise. (*mul_neg): Likewise. (*mulsi_neg_uxtw): Likewise. diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index a3ccbbe791f94ff08d114af81e2b870919242458..73559b52ac24c58a8e23a297eac6d9a58b37b8fe 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -3385,7 +3385,7 @@ (define_insn "mul3" (match_operand:GPI 2 "register_operand" "r")))] "" "mul\\t%0, %1, %2" - [(set_attr "type" "mul")] + [(set_attr "type" "mla")] ) ;; zero_extend version of above @@ -3396,7 +3396,7 @@ (define_insn "*mulsi3_uxtw" (match_operand:SI 2 "register_operand" "r"))))] "" "mul\\t%w0, %w1, %w2" - [(set_attr "type" "mul")] + [(set_attr "type" "mla")] ) (define_insn "madd" @@ -3452,7 +3452,7 @@ (define_insn "*mul_neg" "" "mneg\\t%0, %1, %2" - [(set_attr "type" "mul")] + [(set_attr "type" "mla")] ) ;; zero_extend version of above @@ -3464,7 +3464,7 @@ (define_insn "*mulsi_neg_uxtw" "" "mneg\\t%w0, %w1, %w2" - [(set_attr "type" "mul")] + [(set_attr "type" "mla")] ) (define_insn "mulsidi3"