public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* Re: expanding 1 insn to 2
       [not found] ` <3291F72D-A059-4CDB-B4C7-4764DA818D0E@earthlink.net>
@ 2011-08-26 15:06   ` Aurelien Buhrig
  2011-08-30 13:38     ` Aurelien Buhrig
  0 siblings, 1 reply; 3+ messages in thread
From: Aurelien Buhrig @ 2011-08-26 15:06 UTC (permalink / raw)
  To: Alan Lehotsky; +Cc: cgen

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.  I assume use used cgen to build 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: expanding 1 insn to 2
  2011-08-26 15:06   ` expanding 1 insn to 2 Aurelien Buhrig
@ 2011-08-30 13:38     ` Aurelien Buhrig
  2011-08-30 13:57       ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: Aurelien Buhrig @ 2011-08-30 13:38 UTC (permalink / raw)
  To: cgen

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 <aurelien.buhrig.gcc@gmail.com>:
> 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.  I assume use used cgen to build 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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: expanding 1 insn to 2
  2011-08-30 13:38     ` Aurelien Buhrig
@ 2011-08-30 13:57       ` Frank Ch. Eigler
  0 siblings, 0 replies; 3+ messages in thread
From: Frank Ch. Eigler @ 2011-08-30 13:57 UTC (permalink / raw)
  To: Aurelien Buhrig; +Cc: cgen

Hi -

> 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" ?

I believe few of us have current working memories of this area of the
code.  It does seem like something the assembler-side hand-written
code would have to do.  The complex-relocation bfd/gas facility might
be of use also.

- FChE

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-30 13:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1314359986.11346.ezmlm@sourceware.org>
     [not found] ` <3291F72D-A059-4CDB-B4C7-4764DA818D0E@earthlink.net>
2011-08-26 15:06   ` expanding 1 insn to 2 Aurelien Buhrig
2011-08-30 13:38     ` Aurelien Buhrig
2011-08-30 13:57       ` Frank Ch. Eigler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).