From patchwork Tue Jun 11 13:51:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaushik Phatak X-Patchwork-Id: 250549 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 608ED2C008A for ; Wed, 12 Jun 2013 00:00:30 +1000 (EST) 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:references:in-reply-to :content-type:content-transfer-encoding:mime-version; q=dns; s= default; b=Qsv+cVxEWdxDqmXy1IAJzEoeuVuWzk3EtnpqYajzFBbyAbYkjJfKq GnOvAxcLAryScTvAIgMYNIGNn7E57nMh9UBhUu+v8sX8/iJdi2xPq/GlXkwl//aw Fsc8OTjpQmcK9x0t4qWFqStXHMIM4ORFr5lqfqfKGaqAxEkXx2UBy8= 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:references:in-reply-to :content-type:content-transfer-encoding:mime-version; s=default; bh=5/R7lzt3SRT7HmZAsf6qtZKflRU=; b=EX29eN0QIE3+kRMnfqsSnAnzkwvG Lt2PGC6zvLQHAETsm0vdc+ZGB02HVfGdMxZytv1y85ORmmE87HNUvFjkFn+cuKvB CG/ZwPMHoG/cuomJhtrgp8bmPA8xW9oBMASs5aOjPwIjHf7viVL8edqCkFThL1xt G7hQLy3wEMo1Szw= Received: (qmail 18076 invoked by alias); 11 Jun 2013 14:00:23 -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 18064 invoked by uid 89); 11 Jun 2013 14:00:22 -0000 X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, TW_LQ, TW_OV, TW_XF autolearn=ham version=3.3.1 Received: from va3ehsobe002.messaging.microsoft.com (HELO va3outboundpool.messaging.microsoft.com) (216.32.180.12) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 11 Jun 2013 14:00:21 +0000 Received: from mail105-va3-R.bigfish.com (10.7.14.250) by VA3EHSOBE009.bigfish.com (10.7.40.29) with Microsoft SMTP Server id 14.1.225.23; Tue, 11 Jun 2013 14:00:18 +0000 Received: from mail105-va3 (localhost [127.0.0.1]) by mail105-va3-R.bigfish.com (Postfix) with ESMTP id 4E8BE160122; Tue, 11 Jun 2013 14:00:18 +0000 (UTC) X-Forefront-Antispam-Report: CIP:59.163.77.45; KIP:(null); UIP:(null); IPV:NLI; H:KCHJEXHC01.kpit.com; RD:59.163.77.45.static.vsnl.net.in; EFVD:NLI X-SpamScore: -1 X-BigFish: VPS-1(zz1447Izz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzzz2dh2a8h668h839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h14ddh1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1155h) Received: from mail105-va3 (localhost.localdomain [127.0.0.1]) by mail105-va3 (MessageSwitch) id 1370959216691869_28551; Tue, 11 Jun 2013 14:00:16 +0000 (UTC) Received: from VA3EHSMHS011.bigfish.com (unknown [10.7.14.250]) by mail105-va3.bigfish.com (Postfix) with ESMTP id 9B0ED380046; Tue, 11 Jun 2013 14:00:16 +0000 (UTC) Received: from KCHJEXHC01.kpit.com (59.163.77.45) by VA3EHSMHS011.bigfish.com (10.7.99.21) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 11 Jun 2013 14:00:16 +0000 Received: from KCHJEXMB02.kpit.com ([169.254.2.54]) by KCHJEXHC01.kpit.com ([172.10.15.73]) with mapi id 14.03.0123.003; Tue, 11 Jun 2013 19:21:53 +0530 From: Kaushik Phatak To: DJ Delorie CC: "gcc-patches@gcc.gnu.org" Subject: RE: new mul* patterns "U" constraint in rl78 Date: Tue, 11 Jun 2013 13:51:52 +0000 Message-ID: References: <201306061928.r56JSEer014307@greed.delorie.com> <201306101849.r5AIn3O3002938@greed.delorie.com> In-Reply-To: <201306101849.r5AIn3O3002938@greed.delorie.com> MIME-Version: 1.0 X-OriginatorOrg: kpitcummins.com Hi DJ, > "umul" is used when the insn takes two operands in A and X, and computes a value into AX. > "macax" is used when the insn pattern itself reads from two virtual registers and writes to a > virtual register (i.e. V = V op V), but clobbers AX anx BC in the process. Thanks for the clarification. I have updated the patch as below, adding "macax" for *mulhi3_rl78 pattern, while the other 2 use "umul" Let me know if below modified patch is OK to commit. Regards, Kaushik Index: gcc/config/rl78/constraints.md =================================================================== --- gcc/config/rl78/constraints.md (revision 199949) +++ gcc/config/rl78/constraints.md (working copy) @@ -256,6 +256,19 @@ (match_test "!rl78_far_p (op) && rl78_as_legitimate_address (VOIDmode, XEXP (op, 0), true, ADDR_SPACE_GENERIC)")) ) +(define_memory_constraint "U" + "memory references valid with mov to/from a/ax" + (and (match_code "mem") + (match_test "rl78_virt_insns_ok () +|| satisfies_constraint_Wab (op) +|| satisfies_constraint_Wbc (op) +|| satisfies_constraint_Wde (op) +|| satisfies_constraint_Wd2 (op) +|| satisfies_constraint_Whl (op) +|| satisfies_constraint_Wh1 (op) +|| satisfies_constraint_Whb (op) +|| satisfies_constraint_Ws1 (op) +|| satisfies_constraint_Wfr (op) "))) (define_memory_constraint "Qbi" "built-in compare types" Index: gcc/config/rl78/rl78.md =================================================================== --- gcc/config/rl78/rl78.md (revision 199949) +++ gcc/config/rl78/rl78.md (working copy) @@ -276,6 +276,7 @@ mov a, x mov %h0, a ; end of mulqi macro" +;; [(set_attr "valloc" "umul")] ) (define_insn "*mulhi3_rl78" @@ -290,6 +291,7 @@ mulhu ; bcax = bc * ax movw %h0, ax ; end of mulhi macro" +;; [(set_attr "valloc" "macax")] ) (define_insn "*mulhi3_g13" @@ -309,6 +311,7 @@ movw ax, 0xffff6 ; MDBL movw %h0, ax ; end of mulhi macro" +;; [(set_attr "valloc" "umul")] ) ;; 0xFFFF0 is MACR(L). 0xFFFF2 is MACR(H) but we don't care about it