From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30572 invoked by alias); 28 Apr 2016 17:46:36 -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 30556 invoked by uid 89); 28 Apr 2016 17:46:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 spammy=Hx-languages-length:1556, letter X-HELO: mailrelay2.public.one.com Received: from mailrelay2.public.one.com (HELO mailrelay2.public.one.com) (91.198.169.125) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 28 Apr 2016 17:46:26 +0000 X-HalOne-Cookie: 877e97ab310a3623ffb4847c5de1892f84a995da X-HalOne-ID: 1c5cd3de-0d69-11e6-8278-b82a72d03b9b Received: from localhost.localdomain (unknown [91.135.11.213]) by smtpfilter2.public.one.com (Halon Mail Gateway) with ESMTPSA; Thu, 28 Apr 2016 17:46:17 +0000 (UTC) Subject: Re: [PATCH] [ARC] Fix unwanted match for sign extend 16-bit constant. To: Claudiu Zissulescu , gcc-patches@gcc.gnu.org References: <5721F84D.2090002@amylaar.uk> <1461863430-22916-1-git-send-email-claziss@synopsys.com> Cc: Francois.Bedard@synopsys.com, jeremy.bennett@embecosm.com From: Joern Wolfgang Rennecke Message-ID: <57224C68.6010603@amylaar.uk> Date: Thu, 28 Apr 2016 17:46:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1461863430-22916-1-git-send-email-claziss@synopsys.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-04/txt/msg01880.txt.bz2 On 28/04/16 18:10, Claudiu Zissulescu wrote: > Please find the updated patch. > > Claudiu > > gcc/ > 2016-04-28 Claudiu Zissulescu > > * config/arc/arc.h (UNSIGNED_INT12, UNSIGNED_INT16): Define. > * config/arc/arc.md (umulhisi3): Use arc_short_operand predicate. > (umulhisi3_imm): Update predicates and constraint letters. > (umulhisi3_reg): Declare instruction as commutative. > * config/arc/constraints.md (U12, U16): New constraints. I'm not sure how to feel about this. U16 looks intuitive, but we have traditionally used U for memory constraints. And we use it for ARC for that purpose, too, even though with a compatible constraint length of 3. I suppose it's fine if you're sure we never want to have an addressing mode that's best described with "12" or "16", or some other number we might want for an unsigned integer. Otherwise, I'd suggest using a traditional integer letter. 'J' is free. > > (define_expand "umulhisi3" > [(set (match_operand:SI 0 "register_operand" "") > (mult:SI (zero_extend:SI (match_operand:HI 1 "register_operand" "")) > - (zero_extend:SI (match_operand:HI 2 "nonmemory_operand" ""))))] > + (zero_extend:SI (match_operand:HI 2 "arc_short_operand" ""))))] > "TARGET_MPYW" > "{ > if (CONSTANT_P (operands[2])) > { > - emit_insn (gen_umulhisi3_imm (operands[0], operands[1], operands[2])); > - DONE; > + emit_insn (gen_umulhisi3_imm (operands[0], operands[1], operands[2])); > + DONE; Why do you remove half of the indentation?