From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47192 invoked by alias); 18 Apr 2016 14:35:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 46853 invoked by uid 89); 18 Apr 2016 14:35:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*RU:sk:smtprel, Hx-spam-relays-external:sk:smtprel, HX-HELO:sk:smtprel, geu X-HELO: smtprelay.synopsys.com Received: from smtprelay4.synopsys.com (HELO smtprelay.synopsys.com) (198.182.47.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 18 Apr 2016 14:35:25 +0000 Received: from us02secmta1.synopsys.com (us02secmta1.synopsys.com [10.12.235.96]) by smtprelay.synopsys.com (Postfix) with ESMTP id 91ABB24E1F5B; Mon, 18 Apr 2016 07:35:23 -0700 (PDT) Received: from us02secmta1.internal.synopsys.com (us02secmta1.internal.synopsys.com [127.0.0.1]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id 8F4E94E213; Mon, 18 Apr 2016 07:35:23 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id 5A2574E202; Mon, 18 Apr 2016 07:35:23 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 42E84B99; Mon, 18 Apr 2016 07:35:23 -0700 (PDT) Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) by mailhost.synopsys.com (Postfix) with ESMTP id 39B61B97; Mon, 18 Apr 2016 07:35:23 -0700 (PDT) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by US01WXQAHTC1.internal.synopsys.com (10.12.238.230) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 18 Apr 2016 07:35:23 -0700 Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by IN01WEHTCB.internal.synopsys.com (10.144.199.105) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 18 Apr 2016 20:05:21 +0530 Received: from nl20droid1.internal.synopsys.com (10.100.24.228) by IN01WEHTCA.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 18 Apr 2016 20:05:21 +0530 From: Claudiu Zissulescu To: CC: , , , Subject: [PATCH 6/6] [ARC] Various instruction pattern fixes Date: Mon, 18 Apr 2016 14:35:00 -0000 Message-ID: <1460990028-5718-7-git-send-email-claziss@synopsys.com> In-Reply-To: <1460990028-5718-1-git-send-email-claziss@synopsys.com> References: <1460990028-5718-1-git-send-email-claziss@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2016-04/txt/msg00858.txt.bz2 OK to apply? Claudiu gcc/ 2016-04-18 Claudiu Zissulescu * config/arc/arc.md (mulsidi3): Change operand 0 predicate to register_operand. (umulsidi3): Likewise. (indirect_jump): Fix jump instruction assembly patterns. (arcset): Change operand 1 predicate to nonmemory_operand. (arcsetltu, arcsetgeu): Likewise. (arcsethi, arcsetls): Fix pattern. --- gcc/config/arc/arc.md | 125 +++++++++++++++++++++++++++----------------------- 1 file changed, 67 insertions(+), 58 deletions(-) diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index 6731072..170ac1c 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -1964,7 +1964,7 @@ (set_attr "cond" "nocond,canuse,nocond,canuse_limm,canuse,nocond")]) (define_expand "mulsidi3" - [(set (match_operand:DI 0 "nonimmediate_operand" "") + [(set (match_operand:DI 0 "register_operand" "") (mult:DI (sign_extend:DI(match_operand:SI 1 "register_operand" "")) (sign_extend:DI(match_operand:SI 2 "nonmemory_operand" ""))))] "TARGET_ANY_MPY" @@ -2200,9 +2200,9 @@ }") (define_expand "umulsidi3" - [(set (match_operand:DI 0 "nonimmediate_operand" "") - (mult:DI (zero_extend:DI(match_operand:SI 1 "register_operand" "")) - (zero_extend:DI(match_operand:SI 2 "nonmemory_operand" ""))))] + [(set (match_operand:DI 0 "register_operand" "") + (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "")) + (zero_extend:DI (match_operand:SI 2 "nonmemory_operand" ""))))] "" { if (TARGET_MPY) @@ -3673,7 +3673,12 @@ (define_insn "indirect_jump" [(set (pc) (match_operand:SI 0 "nonmemory_operand" "L,I,Cal,Rcqq,r"))] "" - "j%!%* [%0]%&" + "@ + j%!%* %0%& + j%!%* %0%& + j%!%* %0%& + j%!%* [%0]%& + j%!%* [%0]%&" [(set_attr "type" "jump") (set_attr "iscompact" "false,false,false,maybe,false") (set_attr "cond" "canuse,canuse_limm,canuse,canuse,canuse")]) @@ -5425,90 +5430,94 @@ (define_code_iterator arcCC_cond [eq ne gt lt ge le]) (define_insn "arcset" - [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r") - (arcCC_cond:SI (match_operand:SI 1 "register_operand" "0,r,0,r,0,0,r") - (match_operand:SI 2 "nonmemory_operand" "r,r,L,L,I,n,n")))] + [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r") + (arcCC_cond:SI (match_operand:SI 1 "nonmemory_operand" "0,r,n,0,r,0,0,r") + (match_operand:SI 2 "nonmemory_operand" "r,r,r,L,L,I,n,n")))] "TARGET_V2 && TARGET_CODE_DENSITY" "set%? %0, %1, %2" - [(set_attr "length" "4,4,4,4,4,8,8") + [(set_attr "length" "4,4,8,4,4,4,8,8") (set_attr "iscompact" "false") (set_attr "type" "compare") - (set_attr "predicable" "yes,no,yes,no,no,yes,no") - (set_attr "cond" "canuse,nocond,canuse,nocond,nocond,canuse,nocond") + (set_attr "predicable" "yes,no,no,yes,no,no,yes,no") + (set_attr "cond" "canuse,nocond,nocond,canuse,nocond,nocond,canuse,nocond") ]) (define_insn "arcsetltu" - [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r, r, r") - (ltu:SI (match_operand:SI 1 "register_operand" "0,r,0,r,0, 0, r") - (match_operand:SI 2 "nonmemory_operand" "r,r,L,L,I, n, n")))] + [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r, r, r") + (ltu:SI (match_operand:SI 1 "nonmemory_operand" "0,r,n,0,r,0, 0, r") + (match_operand:SI 2 "nonmemory_operand" "r,r,r,L,L,I, n, n")))] "TARGET_V2 && TARGET_CODE_DENSITY" "setlo%? %0, %1, %2" - [(set_attr "length" "4,4,4,4,4,8,8") + [(set_attr "length" "4,4,8,4,4,4,8,8") (set_attr "iscompact" "false") (set_attr "type" "compare") - (set_attr "predicable" "yes,no,yes,no,no,yes,no") - (set_attr "cond" "canuse,nocond,canuse,nocond,nocond,canuse,nocond") + (set_attr "predicable" "yes,no,no,yes,no,no,yes,no") + (set_attr "cond" "canuse,nocond,nocond,canuse,nocond,nocond,canuse,nocond") ]) (define_insn "arcsetgeu" - [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r, r, r") - (geu:SI (match_operand:SI 1 "register_operand" "0,r,0,r,0, 0, r") - (match_operand:SI 2 "nonmemory_operand" "r,r,L,L,I, n, n")))] + [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r, r, r") + (geu:SI (match_operand:SI 1 "nonmemory_operand" "0,r,n,0,r,0, 0, r") + (match_operand:SI 2 "nonmemory_operand" "r,r,r,L,L,I, n, n")))] "TARGET_V2 && TARGET_CODE_DENSITY" "seths%? %0, %1, %2" - [(set_attr "length" "4,4,4,4,4,8,8") + [(set_attr "length" "4,4,8,4,4,4,8,8") (set_attr "iscompact" "false") (set_attr "type" "compare") - (set_attr "predicable" "yes,no,yes,no,no,yes,no") - (set_attr "cond" "canuse,nocond,canuse,nocond,nocond,canuse,nocond") + (set_attr "predicable" "yes,no,no,yes,no,no,yes,no") + (set_attr "cond" "canuse,nocond,nocond,canuse,nocond,nocond,canuse,nocond") ]) ;; Special cases of SETCC (define_insn_and_split "arcsethi" - [(set (match_operand:SI 0 "register_operand" "=r,r, r,r") - (gtu:SI (match_operand:SI 1 "register_operand" "r,r, r,r") - (match_operand:SI 2 "nonmemory_operand" "0,r,C62,n")))] + [(set (match_operand:SI 0 "register_operand" "=r, r,r,r") + (gtu:SI (match_operand:SI 1 "nonmemory_operand" "r, r,r,n") + (match_operand:SI 2 "nonmemory_operand" "r,C62,n,r")))] "TARGET_V2 && TARGET_CODE_DENSITY" - "setlo%? %0, %2, %1" - "reload_completed - && CONST_INT_P (operands[2]) - && satisfies_constraint_C62 (operands[2])" + "#" + "reload_completed" [(const_int 0)] "{ - /* sethi a,b,u6 => seths a,b,u6 + 1. */ - operands[2] = GEN_INT (INTVAL (operands[2]) + 1); - emit_insn (gen_arcsetgeu (operands[0], operands[1], operands[2])); - DONE; + if (CONST_INT_P (operands[2]) && satisfies_constraint_C62 (operands[2])) + { + /* sethi a,b,u6 => seths a,b,u6 + 1. */ + operands[2] = GEN_INT (INTVAL (operands[2]) + 1); + emit_insn (gen_arcsetgeu (operands[0], operands[1], operands[2])); + DONE; + } + else + { + emit_insn (gen_arcsetltu (operands[0], operands[2], operands[1])); + DONE; + } }" - [(set_attr "length" "4,4,4,8") - (set_attr "iscompact" "false") - (set_attr "type" "compare") - (set_attr "predicable" "yes,no,no,no") - (set_attr "cond" "canuse,nocond,nocond,nocond")] -) + [(set_attr "length" "4,4,8,8") + (set_attr "type" "compare")]) (define_insn_and_split "arcsetls" - [(set (match_operand:SI 0 "register_operand" "=r,r, r,r") - (leu:SI (match_operand:SI 1 "register_operand" "r,r, r,r") - (match_operand:SI 2 "nonmemory_operand" "0,r,C62,n")))] + [(set (match_operand:SI 0 "register_operand" "=r, r,r,r") + (leu:SI (match_operand:SI 1 "nonmemory_operand" "r, r,r,n") + (match_operand:SI 2 "nonmemory_operand" "r,C62,n,r")))] "TARGET_V2 && TARGET_CODE_DENSITY" - "seths%? %0, %2, %1" - "reload_completed - && CONST_INT_P (operands[2]) - && satisfies_constraint_C62 (operands[2])" + "#" + "reload_completed" [(const_int 0)] "{ - /* setls a,b,u6 => setlo a,b,u6 + 1. */ - operands[2] = GEN_INT (INTVAL (operands[2]) + 1); - emit_insn (gen_arcsetltu (operands[0], operands[1], operands[2])); - DONE; - }" - [(set_attr "length" "4,4,4,8") - (set_attr "iscompact" "false") - (set_attr "type" "compare") - (set_attr "predicable" "yes,no,no,no") - (set_attr "cond" "canuse,nocond,nocond,nocond")] -) + if (CONST_INT_P (operands[2]) && satisfies_constraint_C62 (operands[2])) + { + /* setls a,b,u6 => setlo a,b,u6 + 1. */ + operands[2] = GEN_INT (INTVAL (operands[2]) + 1); + emit_insn (gen_arcsetltu (operands[0], operands[1], operands[2])); + DONE; + } + else + { + emit_insn (gen_arcsetgeu (operands[0], operands[2], operands[1])); + DONE; + } + }" + [(set_attr "length" "4,4,8,8") + (set_attr "type" "compare")]) ; Any mode that needs to be solved by secondary reload (define_mode_iterator SRI [QI HI]) -- 1.9.1