From patchwork Tue Oct 22 08:21:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu Ianculescu X-Patchwork-Id: 1181141 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=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-511480-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="fTv4LzUV"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Slc4TP9p"; 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 46y61v5mSGz9sNx for ; Tue, 22 Oct 2019 19:22:27 +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=TFC fznoOojd1l0oYvjpbV79130zxBRpl8PSzN1J7Y0mSPDFN42iYuOqnc5eIdabEtTe VmvLL32jfvruA1x8FQ4vWngS+IeTSPa2GwjraCnExM0H2ug7vg4B/6AJSBpEvWgE lWf7BZdaJOy3aBeFmkm++EiaGy1M2wl1oNTnd4mE= 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=whxYQgUbW NN1wYH45N50FbgyB+Y=; b=fTv4LzUVCJU4L1ujweBfaA0UhDftTHnnYz50d+Xfi NJaF9Y16M/rmFDUdBYxzB73sCgxmA/25SCTA0B9y3LNylizBqzo+RDxsSOcXcFo/ ThBycIVn0z4kNS8GxKP3JQjr0mjDhkU+OERz6PUEo9gsCT1CKorqiyAjZvNK8zIR Lo= Received: (qmail 113439 invoked by alias); 22 Oct 2019 08:22:10 -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 113365 invoked by uid 89); 22 Oct 2019 08:22:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, LIKELY_SPAM_BODY, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=sex, HContent-Transfer-Encoding:8bit X-HELO: mail-wr1-f67.google.com Received: from mail-wr1-f67.google.com (HELO mail-wr1-f67.google.com) (209.85.221.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Oct 2019 08:22:07 +0000 Received: by mail-wr1-f67.google.com with SMTP id p4so16945756wrm.8 for ; Tue, 22 Oct 2019 01:22:07 -0700 (PDT) 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=eF/6QYwWTpooyA29w0u7KIKA9cgUWiLNT9zkOMhd4CI=; b=Slc4TP9pY0bHh1/kz+pF4KYKIow3kpnadCnnkxmrC0p+MCeV0Vz0qm6Go5D/zRe0+4 +0RaFjNXwn1qehyNzIYvLcTawHe4YwwucHJUOXnOebmT8HnZTGc3/RlFdF3qW+ThMGUy 6oVN/6MlPfpho1EQmZX/Gn8EN9ndLJZ9ZoLfHfXDh0y0R6ryZVv2qdMpFOHvSuVxo5e5 zMdE+KwQN0X6LrhGYmpy9UGfLrzwkaOohST24iIcu3EBZFBX7iwzvCQRqFloYWKhoAD5 8PEeESW1VVOHi88oPKGJjMCojTLkKYmOoG2VSA6mb9UtWV125W/4tYRVOV1ZtEBNR1y1 kiZw== Received: from localhost.localdomain ([86.121.123.248]) by smtp.gmail.com with ESMTPSA id i18sm16458026wrx.14.2019.10.22.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 01:22:04 -0700 (PDT) From: Claudiu Zissulescu To: gcc-patches@gcc.gnu.org Cc: fbedard@synopsys.com, andrew.burgess@embecosm.com, claziss@synopsys.com Subject: [PATCH 1/3] [ARC] Cleanup sign/zero extend patterns Date: Tue, 22 Oct 2019 11:21:52 +0300 Message-Id: <20191022082154.16355-2-claziss@gmail.com> In-Reply-To: <20191022082154.16355-1-claziss@gmail.com> References: <20191022082154.16355-1-claziss@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes Cleanup sign/zero extend patterns (corrects the asm output string and constraint letters). gcc/ xxxx-xx-xx Claudiu Zissulescu * config/arc/arc.md (zero_extendqihi2_i): Cleanup pattern. (zero_extendqisi2_ac): Likewise. (zero_extendhisi2_i): Likewise. (extendqihi2_i): Likewise. (extendqisi2_ac): Likewise. (extendhisi2_i): Likewise. --- gcc/config/arc/arc.md | 105 ++++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 49 deletions(-) diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index e1ecf7d3c73..e08aaf8f09a 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -1838,18 +1838,22 @@ archs4x, archs4xd" [(set_attr "type" "cmove,cmove") (set_attr "length" "8,16")]) +;; ------------------------------------------------------------------- +;; Sign/Zero extension +;; ------------------------------------------------------------------- (define_insn "*zero_extendqihi2_i" - [(set (match_operand:HI 0 "dest_reg_operand" "=Rcq,Rcq#q,Rcw,w,r,r") - (zero_extend:HI (match_operand:QI 1 "nonvol_nonimm_operand" "0,Rcq#q,0,c,Ucm,m")))] + [(set (match_operand:HI 0 "dest_reg_operand" "=q,q,r,r,r,r") + (zero_extend:HI + (match_operand:QI 1 "nonvol_nonimm_operand" "0,q,0,r,Ucm,m")))] "" "@ - extb%? %0,%1%& - extb%? %0,%1%& - bmsk%? %0,%1,7 - extb %0,%1 - xldb%U1 %0,%1 - ldb%U1 %0,%1" + extb%?\\t%0,%1 + extb%?\\t%0,%1 + bmsk%?\\t%0,%1,7 + extb\\t%0,%1 + xldb%U1\\t%0,%1 + ldb%U1\\t%0,%1" [(set_attr "type" "unary,unary,unary,unary,load,load") (set_attr "iscompact" "maybe,true,false,false,false,false") (set_attr "predicable" "no,no,yes,no,no,no")]) @@ -1862,18 +1866,19 @@ archs4x, archs4xd" ) (define_insn "*zero_extendqisi2_ac" - [(set (match_operand:SI 0 "dest_reg_operand" "=Rcq,Rcq#q,Rcw,w,qRcq,!*x,r,r") - (zero_extend:SI (match_operand:QI 1 "nonvol_nonimm_operand" "0,Rcq#q,0,c,T,Usd,Ucm,m")))] + [(set (match_operand:SI 0 "dest_reg_operand" "=q,q,r,r,q,!*x,r,r") + (zero_extend:SI + (match_operand:QI 1 "nonvol_nonimm_operand" "0,q,0,r,T,Usd,Ucm,m")))] "" "@ - extb%? %0,%1%& - extb%? %0,%1%& - bmsk%? %0,%1,7 - extb %0,%1 - ldb%? %0,%1%& - ldb%? %0,%1%& - xldb%U1 %0,%1 - ldb%U1 %0,%1" + extb%?\\t%0,%1 + extb%?\\t%0,%1 + bmsk%?\\t%0,%1,7 + extb\\t%0,%1 + ldb%?\\t%0,%1 + ldb%?\\t%0,%1 + xldb%U1\\t%0,%1 + ldb%U1\\t%0,%1" [(set_attr "type" "unary,unary,unary,unary,load,load,load,load") (set_attr "iscompact" "maybe,true,false,false,true,true,false,false") (set_attr "predicable" "no,no,yes,no,no,no,no,no")]) @@ -1886,23 +1891,23 @@ archs4x, archs4xd" ) (define_insn "*zero_extendhisi2_i" - [(set (match_operand:SI 0 "dest_reg_operand" "=Rcq,q,Rcw,w,!x,Rcqq,r,r") - (zero_extend:SI (match_operand:HI 1 "nonvol_nonimm_operand" "0,q,0,c,Usd,T,Ucm,m")))] + [(set (match_operand:SI 0 "dest_reg_operand" "=q,q,r,r,!x,q,r,r") + (zero_extend:SI + (match_operand:HI 1 "nonvol_nonimm_operand" "0,q,0,r,Usd,T,Ucm,m")))] "" "@ - ext%_%? %0,%1%& - ext%_%? %0,%1%& - bmsk%? %0,%1,15 - ext%_ %0,%1 - ld%_%? %0,%1 - ld%_%? %0,%1 - * return TARGET_EM ? \"xldh%U1%V1 %0,%1\" : \"xldw%U1 %0,%1\"; - ld%_%U1%V1 %0,%1" + ext%_%?\\t%0,%1 + ext%_%?\\t%0,%1 + bmsk%?\\t%0,%1,15 + ext%_\\t%0,%1 + ld%_%?\\t%0,%1 + ld%_%?\\t%0,%1 + xldw%U1\\t%0,%1 + ld%_%U1%V1\\t%0,%1" [(set_attr "type" "unary,unary,unary,unary,load,load,load,load") (set_attr "iscompact" "maybe,true,false,false,true,true,false,false") (set_attr "predicable" "no,no,yes,no,no,no,no,no")]) - (define_expand "zero_extendhisi2" [(set (match_operand:SI 0 "dest_reg_operand" "") (zero_extend:SI (match_operand:HI 1 "nonvol_nonimm_operand" "")))] @@ -1913,19 +1918,19 @@ archs4x, archs4xd" ;; Sign extension instructions. (define_insn "*extendqihi2_i" - [(set (match_operand:HI 0 "dest_reg_operand" "=Rcqq,r,r,r") - (sign_extend:HI (match_operand:QI 1 "nonvol_nonimm_operand" "Rcqq,r,Uex,m")))] + [(set (match_operand:HI 0 "dest_reg_operand" "=q,r,r,r") + (sign_extend:HI + (match_operand:QI 1 "nonvol_nonimm_operand" "q,r,Uex,m")))] "" "@ - sexb%? %0,%1%& - sexb %0,%1 - ldb.x%U1 %0,%1 - ldb.x%U1 %0,%1" + sexb%?\\t%0,%1 + sexb\\t%0,%1 + ldb.x%U1\\t%0,%1 + ldb.x%U1\\t%0,%1" [(set_attr "type" "unary,unary,load,load") (set_attr "iscompact" "true,false,false,false") (set_attr "length" "*,*,*,8")]) - (define_expand "extendqihi2" [(set (match_operand:HI 0 "dest_reg_operand" "") (sign_extend:HI (match_operand:QI 1 "nonvol_nonimm_operand" "")))] @@ -1934,14 +1939,15 @@ archs4x, archs4xd" ) (define_insn "*extendqisi2_ac" - [(set (match_operand:SI 0 "dest_reg_operand" "=Rcqq,w,r,r") - (sign_extend:SI (match_operand:QI 1 "nonvol_nonimm_operand" "Rcqq,c,Uex,m")))] + [(set (match_operand:SI 0 "dest_reg_operand" "=q,r,r,r") + (sign_extend:SI + (match_operand:QI 1 "nonvol_nonimm_operand" "q,r,Uex,m")))] "" "@ - sexb%? %0,%1%& - sexb %0,%1 - ldb.x%U1 %0,%1 - ldb.x%U1 %0,%1" + sexb%?\\t%0,%1 + sexb\\t%0,%1 + ldb.x%U1\\t%0,%1 + ldb.x%U1\\t%0,%1" [(set_attr "type" "unary,unary,load,load") (set_attr "iscompact" "true,false,false,false") (set_attr "length" "*,*,*,8")]) @@ -1954,15 +1960,16 @@ archs4x, archs4xd" ) (define_insn "*extendhisi2_i" - [(set (match_operand:SI 0 "dest_reg_operand" "=Rcqq,w,Rcqq,r,r") - (sign_extend:SI (match_operand:HI 1 "nonvol_nonimm_operand" "Rcqq,c,Ucd,Uex,m")))] + [(set (match_operand:SI 0 "dest_reg_operand" "=q,r,q,r,r") + (sign_extend:SI + (match_operand:HI 1 "nonvol_nonimm_operand" "q,r,Ucd,Uex,m")))] "" "@ - sex%_%? %0,%1%& - sex%_ %0,%1 - ldh%?.x %0,%1%& - ld%_.x%U1%V1 %0,%1 - ld%_.x%U1%V1 %0,%1" + sex%_%?\\t%0,%1 + sex%_\\t%0,%1 + ldh%?.x\\t%0,%1%& + ld%_.x%U1%V1\\t%0,%1 + ld%_.x%U1%V1\\t%0,%1" [(set_attr "type" "unary,unary,load,load,load") (set_attr "iscompact" "true,false,true,false,false") (set_attr "length" "*,*,*,4,8")]) From patchwork Tue Oct 22 08:21:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu Ianculescu X-Patchwork-Id: 1181142 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=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-511481-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="PTNPF/IP"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="duUrHSMZ"; 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 46y6284L83z9sNx for ; Tue, 22 Oct 2019 19:22:40 +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=GLS jO6XMJTaLuyErCAIbum0HmiPfpoMCPJwQ51eZHYTzPH1a9vTiksIkzaysBACEGbR m1vFeyvlfIR9lOJExOjZ/sOjSe8EISHP66QyrLCbrGITus/0bK0P5hLXi7t1C5yc 3E7MjkjAWfFRPwlYVY3sbyrPR6YNNRM9T7DHIrk0= 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=JtPF/IXDf SIUA6G4skAhfUI3O9M=; b=PTNPF/IPHidZ2nnHC1sRlIN9HZSQlPGb6CiSfuC5Y +ctTj24JuXd3ZKjzQ9OSiCNQoCU69p2XckZXr2znxgDQH3M/pW0RdoUyNtJ7HNLv zTuWnc99ofWVwC8z7cos0kul3SZDPv+D6QdkMFEMbfmYzfocbPy3B90h0zJUYI3N zw= Received: (qmail 113488 invoked by alias); 22 Oct 2019 08:22:10 -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 113404 invoked by uid 89); 22 Oct 2019 08:22:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.9 required=5.0 tests=AWL, 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.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: mail-wr1-f51.google.com Received: from mail-wr1-f51.google.com (HELO mail-wr1-f51.google.com) (209.85.221.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Oct 2019 08:22:08 +0000 Received: by mail-wr1-f51.google.com with SMTP id n15so6152481wrw.13 for ; Tue, 22 Oct 2019 01:22:08 -0700 (PDT) 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=Q3+poAypXWhDeScxzmjF20WYOyr5uaPdTuR7Wmfolhc=; b=duUrHSMZZ19FXIXg/aYQaaLmvgtN88+XgFHsAf6NJVewBA/KrAoVHpIzjA9m5Wu+Ty emec2g7H1RDT5Eb92xhya48TWVVXNIP54dINq86t6YZZTnEs8svfChCaKc4HS4AZhx6n dOkUeIPLOCfhrtJUpD2Yyek8PfqYSMTzdu2kiOiG1ejzb0MRuejc8akEiZ2Fy745PxzZ c/mTAvAkH+ikDGszdZwgplHvPvU5hb1+Vzj8sTL9F6MTIKVg9NFHWfA9o5qExYpxh4Vt 1brCgqQjETl88ugI0EeCan+QL/Ug/H1oSKkZpZl8gcnXrnBzW/2nCPsvmMPwBu1kNYUo L6tw== Received: from localhost.localdomain ([86.121.123.248]) by smtp.gmail.com with ESMTPSA id i18sm16458026wrx.14.2019.10.22.01.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 01:22:05 -0700 (PDT) From: Claudiu Zissulescu To: gcc-patches@gcc.gnu.org Cc: fbedard@synopsys.com, andrew.burgess@embecosm.com, claziss@synopsys.com Subject: [PATCH 2/3] [ARC] Update mea option documentation Date: Tue, 22 Oct 2019 11:21:53 +0300 Message-Id: <20191022082154.16355-3-claziss@gmail.com> In-Reply-To: <20191022082154.16355-1-claziss@gmail.com> References: <20191022082154.16355-1-claziss@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes Update -mea option documentation. gcc/ xxxx-xx-xx Claudiu Zissulescu * config/arc/arc.opt (mea): Update help string. * doc/invoke.texi(ARC): Update mea option info. --- gcc/config/arc/arc.opt | 2 +- gcc/doc/invoke.texi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/arc/arc.opt b/gcc/config/arc/arc.opt index e2f1fc6a4cf..b76ca0fedc3 100644 --- a/gcc/config/arc/arc.opt +++ b/gcc/config/arc/arc.opt @@ -167,7 +167,7 @@ Do not generate mpy instructions for ARC700. mea Target Report Mask(EA_SET) -Generate Extended arithmetic instructions. Currently only divaw, adds, subs and sat16 are supported. +Generate extended arithmetic instructions, only valid for ARC700. msoft-float Target Report Mask(0) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 1e10395b61e..aaa6039beaf 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -16504,7 +16504,7 @@ aux registers. @opindex mea Generate extended arithmetic instructions. Currently only @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are -supported. This is always enabled for @option{-mcpu=ARC700}. +supported. Only valid for @option{-mcpu=ARC700}. @item -mno-mpy @opindex mno-mpy From patchwork Tue Oct 22 08:21:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu Ianculescu X-Patchwork-Id: 1181143 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=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-511482-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="fwL2BDwQ"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qvhLZYqm"; 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 46y62P43pxz9sNx for ; Tue, 22 Oct 2019 19:22:52 +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=lEC Rfgf/xvPkVo9RuqCYGC6nbYpLyFyTzelLVBfFkr7zwZwIoYs7U8qw4t6ZSTX0NSg ou65IN2K8wK+PlzEA1GWstz//0YjK7+DgybkMv8M7+Q3nx8Q/kIqEuYNRpWCzzR9 YCPhUc4Wka5ckSgbdwAANz1DX6Y+IJ7BgTC39k38= 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=QtE0liiis QTfocYLY/BW/TNdkyw=; b=fwL2BDwQu1hOvW+OgqRMTGX1UUCbPNXIye9snePn8 cg4Blbw7IzXynGTdpJCz9TnZ5jBPUmqbzGRBkfUP+RI9o3TEYLyw7YOIUqv5BOq7 3/XYcXMX9Trf4B1SkKmAoIZwEL32aeOjpSlnxXJ3beOA4s5cDLGyFi4LMPDKe7JS I8= Received: (qmail 113765 invoked by alias); 22 Oct 2019 08:22:12 -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 113699 invoked by uid 89); 22 Oct 2019 08:22:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, 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.1 spammy=0xffffffff X-HELO: mail-wm1-f66.google.com Received: from mail-wm1-f66.google.com (HELO mail-wm1-f66.google.com) (209.85.128.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Oct 2019 08:22:09 +0000 Received: by mail-wm1-f66.google.com with SMTP id r141so5634001wme.4 for ; Tue, 22 Oct 2019 01:22:09 -0700 (PDT) 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=kbA1YC1AWaTj9WlYZjb6Vjz8f6V7+ATpYEXGCS04/o8=; b=qvhLZYqmgMBw29KhnHsL3YEgixtCht6prm7CgWkMakoISnF7/xuVaEDyB0SH+EUGU9 Qa4kPd1JW5SQVyGSWb5MCmKWJlmu1tpxXfUTeizRolRfbQNQsmp4zxD+WLBVvEfcoVqf zkj9/VLF83RXLC3FU/3ov6vIJKRdkCChStFspdcDbEYigoBr+rmK9q8reBeyvtnvyUv4 u6U8iyUy7Y7GpqUELZ0v79S1GdPX7NxwrHgQbewWWEYRqORfHf4S5gI5Q7wBO0oNQa/j E3yqE87NkyNIbK1HaansOxJMgFw+oGy/ZlJWa+7lhIr26YsGJKQxtUeFD+jCKN8mYzFq /5MQ== Received: from localhost.localdomain ([86.121.123.248]) by smtp.gmail.com with ESMTPSA id i18sm16458026wrx.14.2019.10.22.01.22.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 01:22:06 -0700 (PDT) From: Claudiu Zissulescu To: gcc-patches@gcc.gnu.org Cc: fbedard@synopsys.com, andrew.burgess@embecosm.com, claziss@synopsys.com Subject: [PATCH 3/3] [ARC] Don't split ior/mov predicated insns. Date: Tue, 22 Oct 2019 11:21:54 +0300 Message-Id: <20191022082154.16355-4-claziss@gmail.com> In-Reply-To: <20191022082154.16355-1-claziss@gmail.com> References: <20191022082154.16355-1-claziss@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes Do not split immediate constants for predicated instructions. gcc/ xxxx-xx-xx Claudiu Zissulescu * config/arc/arc.c (arc_split_ior): Add asserts. (arc_split_mov_const): Likewise. (arc_check_ior_const): Do not match known short immediate values. * config/arc/arc.md (movsi): Don't split predicated instructions. (iorsi): Likewise. testsuite/ xxxx-xx-xx Claudiu Zissulescu Sahahb Vahedi Cupertino Miranda * gcc.target/arc/or-cnst-size2.c: New test. --- gcc/config/arc/arc.c | 16 +++++++++++----- gcc/config/arc/arc.md | 13 ++++++++++--- gcc/testsuite/gcc.target/arc/or-cnst-size2.c | 12 ++++++++++++ 3 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 gcc/testsuite/gcc.target/arc/or-cnst-size2.c diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 9c4dee50494..fe5ee8f4104 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -11540,8 +11540,10 @@ arc_split_ior (rtx *operands) emit_insn (gen_rtx_SET (operands[0], gen_rtx_IOR (SImode, op1, GEN_INT (maskx)))); break; - default: + case 0: break; + default: + gcc_unreachable (); } } @@ -11551,6 +11553,10 @@ bool arc_check_ior_const (HOST_WIDE_INT ival) { unsigned int mask = (unsigned int) (ival & 0xffffffff); + + if (UNSIGNED_INT6 (ival) + || IS_POWEROF2_P (mask)) + return false; if (__builtin_popcount (mask) <= 3) return true; if (__builtin_popcount (mask & ~0x3f) <= 1) @@ -11572,9 +11578,6 @@ arc_split_mov_const (rtx *operands) gcc_assert (CONST_INT_P (operands[1])); ival = INTVAL (operands[1]) & 0xffffffff; - if (SIGNED_INT12 (ival)) - return false; - /* 1. Check if we can just rotate limm by 8 but using ROR8. */ if (TARGET_BARREL_SHIFTER && TARGET_V2 && ((ival & ~0x3f000000) == 0)) @@ -11641,7 +11644,7 @@ arc_split_mov_const (rtx *operands) return true; } - return false; + gcc_unreachable (); } /* Helper to check Cax constraint. */ @@ -11651,6 +11654,9 @@ arc_check_mov_const (HOST_WIDE_INT ival) { ival = ival & 0xffffffff; + if (SIGNED_INT12 (ival)) + return false; + if ((ival & ~0x8000001f) == 0) return true; diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index e08aaf8f09a..d2b7a45b6e6 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -825,8 +825,11 @@ archs4x, archs4xd" st%U0%V0\\t%1,%0 ;26 st%U0%V0\\t%1,%0 ;37 st%U0%V0\\t%1,%0 ;28" - "reload_completed && satisfies_constraint_Cax (operands[1]) - && register_operand (operands[0], SImode)" + "reload_completed + && GET_CODE (PATTERN (insn)) != COND_EXEC + && register_operand (operands[0], SImode) + && IN_RANGE (REGNO (operands[0]) ^ 4, 4, 11) + && satisfies_constraint_Cax (operands[1])" [(const_int 0)] " arc_split_mov_const (operands); @@ -3399,7 +3402,11 @@ archs4x, archs4xd" # or%?\\t%0,%1,%2 or%?\\t%0,%1,%2" - "reload_completed && satisfies_constraint_C0x (operands[2])" + "reload_completed + && GET_CODE (PATTERN (insn)) != COND_EXEC + && register_operand (operands[0], SImode) + && IN_RANGE (REGNO (operands[0]) ^ 4, 4, 11) + && satisfies_constraint_C0x (operands[2])" [(const_int 0)] " arc_split_ior (operands); diff --git a/gcc/testsuite/gcc.target/arc/or-cnst-size2.c b/gcc/testsuite/gcc.target/arc/or-cnst-size2.c new file mode 100644 index 00000000000..33af97bbdbf --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/or-cnst-size2.c @@ -0,0 +1,12 @@ +/* Check if we optimize the immediate of a predicated instruction. */ +/* { dg-options "-Os -fif-conversion -fif-conversion2" } */ + +int a; +int foo (void) +{ + if ((a & 60) == 0) + return a | 64; +} + +/* { dg-final { scan-assembler "tst" } } */ +/* { dg-final { scan-assembler "bset.eq" } } */