From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5052 invoked by alias); 23 Apr 2002 22:48:43 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 5043 invoked from network); 23 Apr 2002 22:48:42 -0000 Received: from unknown (HELO avocet.prod.itd.earthlink.net) (207.217.120.50) by sources.redhat.com with SMTP; 23 Apr 2002 22:48:42 -0000 Received: from dialup-63.214.117.144.dial1.boston1.level3.net ([63.214.117.144]) by avocet.prod.itd.earthlink.net with esmtp (Exim 3.33 #2) id 17095T-0007IO-00; Tue, 23 Apr 2002 15:48:41 -0700 Mime-Version: 1.0 X-Sender: qsmgmt@pop.earthlink.net Message-Id: In-Reply-To: <200204232210.g3NMAhM30480@hyper.wm.sps.mot.com> References: <200204232210.g3NMAhM30480@hyper.wm.sps.mot.com> Date: Tue, 23 Apr 2002 16:05:00 -0000 To: Peter Barada From: Alan Lehotsky Subject: Re: peephole2 question Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-SW-Source: 2002-04/txt/msg01208.txt.bz2 You use a "match_dup" in the peephole result and an action statement that does something like (define_peephole2 [(set (match_operand:DF 0 "m68k_freg_operand" "") (mem:DF (match_operand:SI 1 "m68k_areg_operand" ""))) (set (match_operand:DF 2 "m68k_freg_operand" "") (match_operator:DF 3 "plus_or_mult_operator" [(match_dup 2) (match_dup 0)]))] "0 && TARGET_CFV4E && peep2_reg_dead_p (2, operands[0]) && REGNO (operands[0]) != REGNO (operands[2])" [(set (match_dup 2) (match_dup 3) )] " operands[3] = gen_rtx (..... operands[2], operands[1]) ") You might want to make your "plus_or_mult_operator()" function leave the right code somewhere global so that you don't have to grovel thru the pattern to find if it's PLUS or MULT.... At 6:10 PM -0400 4/23/02, Peter Barada wrote: >I've got a peephole2 that uses match_operator to select both PLUS and >MULT. How to I specify in the new-insn-pattern the result of the >match_operator? In the following, what do I put in place of 'xxx' >that means the operator that I think is in operands[3]: > -- Quality Software Management http://home.earthlink.net/~qsmgmt apl@alum.mit.edu (978)287-0435 Voice (978)808-6836 Cell Software Process Improvement / Management Consulting Language Design / Compiler Implementation