From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9860 invoked by alias); 30 Aug 2011 13:38:08 -0000 Received: (qmail 9852 invoked by uid 22791); 30 Aug 2011 13:38:07 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_DN X-Spam-Check-By: sourceware.org Received: from mail-ey0-f169.google.com (HELO mail-ey0-f169.google.com) (209.85.215.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Aug 2011 13:37:53 +0000 Received: by eye22 with SMTP id 22so5382291eye.0 for ; Tue, 30 Aug 2011 06:37:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.14.3.146 with SMTP id 18mr2004269eeh.74.1314711472084; Tue, 30 Aug 2011 06:37:52 -0700 (PDT) Received: by 10.14.48.11 with HTTP; Tue, 30 Aug 2011 06:37:52 -0700 (PDT) In-Reply-To: References: <1314359986.11346.ezmlm@sourceware.org> <3291F72D-A059-4CDB-B4C7-4764DA818D0E@earthlink.net> Date: Tue, 30 Aug 2011 13:38:00 -0000 Message-ID: Subject: Re: expanding 1 insn to 2 From: Aurelien Buhrig To: cgen Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2011-q3/txt/msg00010.txt.bz2 Should I consider this silence as a "it's not possible" answer, as a "cgen is not maintained anymore", or as "everybody is on Holiday" ? Aurelien 2011/8/26 Aurelien Buhrig : > Hi, > > thanks for your reply. > > >> It's possible (and documented in the cgen manual to do this inside cgen - >> see section 5.4.14 Writing define-macro-insn. and section 3.17 >> Macro-instructions > > I've already used dnmi to define 1 pseudo insn which represents > another insn (such as push --> move -(sp)). > My problem here is to define one pseudo instruction such as > ld.a #$abs32 --> r0r1 > to be expanded into 2 real instructions such as > move.w #$abs16_hi --> r0 > move.w #$abs16_lo --> r1 > > I can't see how to emit 2 instructions using define-macro-insn, and > how to tell cgen how to fill abs16_hi and abs16_lo operands from abs32 > (all 3 operands refering to 3 different bfd howtos). > > >> You could also do this in the assembler. =A0I assume use used cgen to bu= ild a >> gas assembler from the binutils distribution. > yes > >> You can either define a .macro that will do what you want assuming that = your >> addressing is simple enough, or you can tweak the md_assemble() function= in >> your assember to parse the operands and break them down appropriately if= you >> need. > > md_assemble only apply on string source and I don't know how to handle > splitting symbol references (to be correctly relocated). > Idem with .macro. > > A workaround can be to define 2 instructions such as ld_hi/ld_lo, > implemented as move with different howtos for relocs. but I would like > to define only one instruction.using cgen if possible... > > Aurelien >