From patchwork Tue Dec 29 11:36:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu Ianculescu X-Patchwork-Id: 1421194 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; dmarc=pass (p=none dis=none) header.from=gcc.gnu.org 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=xZN/WQwK; dkim-atps=neutral Received: from sourceware.org (unknown [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 4D4spp65Pqz9sVt for ; Tue, 29 Dec 2020 22:37:38 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 71C57388A031; Tue, 29 Dec 2020 11:37:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 71C57388A031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1609241836; bh=VmbA4AeCfzUTO5l0ALhVkJghwNiRIc/k8ld8fa7l8tY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=xZN/WQwKLRV8WZp8EjPJunZ3+gtemo1MR2c2iiSZFZmuKcM6z/Z+uK5iiAU2OwHlY uansvMpcGTZEVDJeSsymnZdsSjbubCtS6Tx/dRSi3gXf28zt4v5cwUDTXg4frPVxr0 6zswfzlxwiuVJ9CLdK6W1tCce4irvjpMtduem77w= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 6C074388702F for ; Tue, 29 Dec 2020 11:37:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6C074388702F Received: by mail-ej1-x62d.google.com with SMTP id x16so17779071ejj.7 for ; Tue, 29 Dec 2020 03:37:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VmbA4AeCfzUTO5l0ALhVkJghwNiRIc/k8ld8fa7l8tY=; b=T3xW2bdk6Wm9MOl+VMfjyy7FzsIud9/N+JyVQCWnP2yvCwcMFzCOLawnQk3X2ys4vu hF0GDCtTwVIPn2Sf2J8YdhcOnZrx5ewgEo/rRwIxWxqBWK53uAQ0wy7Or4Ul/BUNeaRV 1CuKpYBv35qXIzq0TYY20ZWfJyTL/KgDRK/IleKX0iP1o69UBAuwe0bB+ZmXpodeEXSZ WGd+1khYhX0jZzlNopzFsLwhoJ/cZ8kWhVFtDvxAPOyguxJDlmhOEFThVrUmvq+yYNWt 47cwtr+mSTTyOjwUFEpnUOWmMfnU3dH+PW7tF0gJumEzacWVu4KEKOTlRC7zp3VDohOo fV3w== X-Gm-Message-State: AOAM531Ilwi/eojLpi4KS872oip47+DQEhvxHuCYtd7Yw7hwQtep///W q2DjgxnvBBr+Wunn7lWSElT/ohbaHVm+2A== X-Google-Smtp-Source: ABdhPJx9/hVSwPLtTNcn3HERUDKUBknvqKgBIjzc+7wDQzfpZXA/cCpkILRW2bVmYCNVGn731Jlzww== X-Received: by 2002:a17:907:3fa3:: with SMTP id hr35mr45347204ejc.71.1609241831284; Tue, 29 Dec 2020 03:37:11 -0800 (PST) Received: from localhost.localdomain ([95.174.67.148]) by smtp.gmail.com with ESMTPSA id gn27sm8452866ejc.122.2020.12.29.03.37.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Dec 2020 03:37:10 -0800 (PST) X-Google-Original-From: Claudiu Zissulescu To: gcc-patches@gcc.gnu.org Subject: [committed 6/6] arc: generate mac(u) insn instead of macd(u) when destination is accl Date: Tue, 29 Dec 2020 13:36:55 +0200 Message-Id: <20201229113655.3761444-6-claziss@synopsys.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201229113655.3761444-1-claziss@synopsys.com> References: <20201229113655.3761444-1-claziss@synopsys.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, 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: Claudiu Zissulescu via Gcc-patches From: Claudiu Zissulescu Ianculescu Reply-To: Claudiu Zissulescu Cc: fbedard@synopsys.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Generate MAC(U) instruction instead of MACD(U) when the destination register is already choosen as ACCL register. gcc/ 2020-12-29 Claudiu Zissulescu * config/arc/arc.md (maddsidi4_split): Skip macd gen, use mac insn instead. (macd): Update register letters. (umaddsidi4_split): Skip macdu gen, use macu insn instead. (macdu): Update register letters. Signed-off-by: Claudiu Zissulescu --- gcc/config/arc/arc.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index 75c32f6d3e9..b616c7fb82c 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -6176,12 +6176,14 @@ (define_insn_and_split "maddsidi4_split" "{ rtx acc_reg = gen_rtx_REG (DImode, ACC_REG_FIRST); emit_move_insn (acc_reg, operands[3]); - if (TARGET_PLUS_MACD && even_register_operand (operands[0], DImode)) - emit_insn (gen_macd (operands[0], operands[1], operands[2])); + if (TARGET_PLUS_MACD && even_register_operand (operands[0], DImode) + && REGNO (operands[0]) != ACCL_REGNO) + emit_insn (gen_macd (operands[0], operands[1], operands[2])); else { emit_insn (gen_mac (operands[1], operands[2])); - emit_move_insn (operands[0], acc_reg); + if (REGNO (operands[0]) != ACCL_REGNO) + emit_move_insn (operands[0], acc_reg); } DONE; }" @@ -6192,8 +6194,8 @@ (define_insn "macd" [(set (match_operand:DI 0 "even_register_operand" "=Rcr,r,r") (plus:DI (mult:DI - (sign_extend:DI (match_operand:SI 1 "register_operand" "%0,c,c")) - (sign_extend:DI (match_operand:SI 2 "extend_operand" " c,cI,Cal"))) + (sign_extend:DI (match_operand:SI 1 "register_operand" "%0,r,r")) + (sign_extend:DI (match_operand:SI 2 "extend_operand" "r,rI,Cal"))) (reg:DI ARCV2_ACC))) (set (reg:DI ARCV2_ACC) (plus:DI @@ -6276,12 +6278,14 @@ (define_insn_and_split "umaddsidi4_split" "{ rtx acc_reg = gen_rtx_REG (DImode, ACC_REG_FIRST); emit_move_insn (acc_reg, operands[3]); - if (TARGET_PLUS_MACD && even_register_operand (operands[0], DImode)) - emit_insn (gen_macdu (operands[0], operands[1], operands[2])); + if (TARGET_PLUS_MACD && even_register_operand (operands[0], DImode) + && REGNO (operands[0]) != ACCL_REGNO) + emit_insn (gen_macdu (operands[0], operands[1], operands[2])); else { emit_insn (gen_macu (operands[1], operands[2])); - emit_move_insn (operands[0], acc_reg); + if (REGNO (operands[0]) != ACCL_REGNO) + emit_move_insn (operands[0], acc_reg); } DONE; }" @@ -6292,8 +6296,8 @@ (define_insn "macdu" [(set (match_operand:DI 0 "even_register_operand" "=Rcr,r,r") (plus:DI (mult:DI - (zero_extend:DI (match_operand:SI 1 "register_operand" "%0,c,c")) - (zero_extend:DI (match_operand:SI 2 "extend_operand" " c,cI,i"))) + (zero_extend:DI (match_operand:SI 1 "register_operand" "%0,r,r")) + (zero_extend:DI (match_operand:SI 2 "extend_operand" "r,rI,i"))) (reg:DI ARCV2_ACC))) (set (reg:DI ARCV2_ACC) (plus:DI