From patchwork Thu Aug 31 05:01:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu Ianculescu X-Patchwork-Id: 137226 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c792:0:b0:3f2:4152:657d with SMTP id b18csp26506vqu; Wed, 30 Aug 2023 22:02:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF53aA7tEVu0DeQ0FEOLEb5ZomAHbwIF6NBnBu5hwmAas0tJY5QnUXC3RBQLi3nrTZCABWm X-Received: by 2002:a17:906:8a77:b0:9a1:bb8f:17ca with SMTP id hy23-20020a1709068a7700b009a1bb8f17camr2969320ejc.1.1693458160919; Wed, 30 Aug 2023 22:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693458160; cv=none; d=google.com; s=arc-20160816; b=P3TkgS2f51VIa4G8Vo1Szq7j2zOQqNMLFmJkwSJkybSS8AxqIggU/fJHanb+RFpXDI DMDuRPotqUmW1p1dRG4tx2iPbMRtPtvfspkW7CKajBK9ZnbT5APPx2gaxHASzFDjNr1/ +dXq+2SyTzH+M+28EFQmGM12NBshmX0+ms9zZ20HNeLWCHwgPuw4390JyLQZoBKn2TQj k8I8hF7AjUkayChAUda1+GxRGoQfevUC3jNhJLD/TKKulsbaFllNfwQnbti8sJKljO9J 3csXCcxqU73v3D0fJogrkBFwlu9m8WkecRF0UgdrxSoJnOGBpWWChuKaJKXXiZhBr/N7 8LLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=5NKxJBMmg33JcB9Qh6WaUnrKjX10rC+r2c6ov/UtmUA=; fh=7jtO1LQ2AGfJSFta5OEKAjdQtDhhgJZg7nT12/P8gFI=; b=MYEWygKGKu/HUNWZsV5+A8yavuQ8TZNroEUv+8tOJ6/SJpo71bBa+w5xm+qsbEq5Vf 6yv9/JRo6geUU/j1qHBfn3oCvyXIbhgaVChmMBlKBEV13WEcAST/mtFKhJrBYGP3/W/Z 2EwQGFig0bz+epdSDM5e5tzFFKsU7Hv7aM0eoicysYplnhevjyXtURPkNByF2i4OQ2pd FE/vsVmos6tQEBwLYVO04X9iW4FeHx3bYnbgRBzhdjzlLjcKN4AMwaPNo/ASMn9ZC365 qhlJNYbhiYaRlwKMFY3tcWNWH4g51i/EbXgYHXVEWRwJE/Nlstyvvj+weclMFUsEtJbr AYmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=M5y7beNm; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id oy25-20020a170907105900b0099b42c9082bsi441939ejb.508.2023.08.30.22.02.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 22:02:40 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=M5y7beNm; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 164E7385770D for ; Thu, 31 Aug 2023 05:02:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 164E7385770D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693458154; bh=5NKxJBMmg33JcB9Qh6WaUnrKjX10rC+r2c6ov/UtmUA=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=M5y7beNmy5ox9/vv03vuCPBr92kY+btNqXHobGptbstq3M11FyPp7S6CUgXOjn1MR r56xd9TkKKdYCbXNIEEeXM+dJ4QlykXkvIVj9ik3yL/+HmiPhBPh8lms5gc6a1pNp5 ggoN1YXFU7uQbGJUC5Jx24GbRST323filiGrTxNI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id A64013858D20 for ; Thu, 31 Aug 2023 05:01:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A64013858D20 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-52a250aa012so413237a12.3 for ; Wed, 30 Aug 2023 22:01:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693458095; x=1694062895; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5NKxJBMmg33JcB9Qh6WaUnrKjX10rC+r2c6ov/UtmUA=; b=Cm8UURTpAcg5Fw3ThAZy4wYM3mTAL3ag6MiMlMY35BIR9/xcem8uYY8ltfFU3dXrOS d4Myu6CUG50cS770BNljcOwcuIh8exWXGUmSZse5ipNyCNGgWJgMIB7B0v503oaUW/Vp FbVot8Vif5d0X/0RPUp5hUh1Pa21jBokFoXAQF2WKINqv02obNmKAvYuvH480hc0xMLk nsE9WxxHJCJRg+3of6j5xuwesOmcKcxrRSppsvaaGAK5zHGlmg6E+YCGxgiYKNrE012y SHrb4cog0w4PSn6iAjXKfT9nGx/kJE8P1xWcFbgO/lUOsDO/oU0cucuib0/n+CWmw3ur 1xNA== X-Gm-Message-State: AOJu0YzIcD2z/Iwh1Hk6KfjpIlba/2+xkBNbnIvxjhwg7M9qorMeLa6e QzD+NLh96YTRmdmjhGq6cDkXwWi+6hQ= X-Received: by 2002:aa7:c6ce:0:b0:525:6c74:5e58 with SMTP id b14-20020aa7c6ce000000b005256c745e58mr3211110eds.23.1693458094692; Wed, 30 Aug 2023 22:01:34 -0700 (PDT) Received: from fatty.nomansland ([193.187.151.25]) by smtp.gmail.com with ESMTPSA id f24-20020aa7d858000000b0052544441babsm346334eds.72.2023.08.30.22.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 22:01:34 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: fbedard@synopsys.com Subject: [committed] arc: Honor SWAP option for lsl16 instruction Date: Thu, 31 Aug 2023 08:01:32 +0300 Message-Id: <20230831050132.733545-1-claziss@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 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 Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775719584434605963 X-GMAIL-MSGID: 1775719584434605963 The LSL16 instruction is only available if SWAP (-mswap) option is turned on. gcc/ChangeLog: * config/arc/arc.cc (arc_split_mov_const): Use LSL16 only when SWAP option is enabled. * config/arc/arc.md (ashlsi2_cnt16): Likewise. Signed-off-by: Claudiu Zissulescu --- gcc/config/arc/arc.cc | 2 +- gcc/config/arc/arc.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/arc/arc.cc b/gcc/config/arc/arc.cc index 266ba8b00bb..8ee7387286e 100644 --- a/gcc/config/arc/arc.cc +++ b/gcc/config/arc/arc.cc @@ -11647,7 +11647,7 @@ arc_split_mov_const (rtx *operands) } /* 3. Check if we can just shift by 16 to fit into the u6 of LSL16. */ - if (TARGET_BARREL_SHIFTER && TARGET_V2 + if (TARGET_SWAP && TARGET_V2 && ((ival & ~0x3f0000) == 0)) { shimm = (ival >> 16) & 0x3f; diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index 1f122d9507f..a4e77a207bf 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -5991,7 +5991,7 @@ (define_insn "*ashlsi2_cnt16" [(set (match_operand:SI 0 "register_operand" "=r") (ashift:SI (match_operand:SI 1 "nonmemory_operand" "rL") (const_int 16)))] - "TARGET_BARREL_SHIFTER && TARGET_V2" + "TARGET_SWAP && TARGET_V2" "lsl16\\t%0,%1" [(set_attr "type" "shift") (set_attr "iscompact" "false")