From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21147 invoked by alias); 21 May 2003 16:46:41 -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 21124 invoked from network); 21 May 2003 16:46:40 -0000 Received: from unknown (HELO motgate.mot.com) (129.188.136.100) by sources.redhat.com with SMTP; 21 May 2003 16:46:40 -0000 Received: from il06exr06.mot.com (il06exr06.mot.com [129.188.137.136]) by motgate.mot.com (Motorola/Motgate) with ESMTP id h4LGkdnF018343 for ; Wed, 21 May 2003 09:46:40 -0700 (MST) Received: from hyper.wm.sps.mot.com ([199.10.246.43]) by il06exr06.mot.com (Motorola/il06exr06) with ESMTP id h4LGkYnf008658 for ; Wed, 21 May 2003 11:46:38 -0500 Received: (from pbarada@localhost) by hyper.wm.sps.mot.com (8.11.6/8.11.6) id h4LGkcx07667; Wed, 21 May 2003 12:46:38 -0400 Date: Wed, 21 May 2003 16:48:00 -0000 Message-Id: <200305211646.h4LGkcx07667@hyper.wm.sps.mot.com> From: Peter Barada To: fcook377@hotmail.com CC: gcc@gcc.gnu.org, Ulrich.Weigand@de.ibm.com In-reply-to: (fcook377@hotmail.com) Subject: Re: Different addressing modes? References: X-SW-Source: 2003-05/txt/msg01944.txt.bz2 >I am still trying to get addressing modes correctly in my port. Basically my >architecture has the following addressing modes: > > 1) absolute > 2) register indirect > 3) register + offset > 4) register + register You may want to go back and read the Compiler internals documentation where it talks about 'predicate' functions (such as general_operand, nonimmediate_operand' that you can use to fine-tune what RTL the insns patterns your port will accept. As an example, in gcc/config/m68k/m68k.md, the 'pushasi' pattern is used to push the address of a varaible/function, etc, and you can see that the destination target predicate of the 'set' is push_operand which restricts the RTL to only allow a push to the stack as the destination, and specifies that the source of the 'set' is an address_operand, a combination of predicates that are valid for the pea instruction: (define_insn "pushasi" [(set (match_operand:SI 0 "push_operand" "=m") (match_operand:SI 1 "address_operand" "p"))] "" "pea %a1") -- Peter Barada Peter.Barada@motorola.com Wizard 781-852-2768 (direct) WaveMark Solutions(A Motorola Company) 781-270-0193 (fax)