public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* Assembler syntax with embedded spaces
@ 2008-01-08 15:26 Will Newton
  2008-01-08 15:32 ` Dave Brolley
  0 siblings, 1 reply; 4+ messages in thread
From: Will Newton @ 2008-01-08 15:26 UTC (permalink / raw)
  To: cgen


Hi all,

Is it possible to use CGEN to generate an assembler/disassembler for an
assembler syntax with whitespace embedded in mnemonics, e.g.:

FD ABS FX.0,FX.1

Where "FD ABS" is the mnemonic (ABS) plus a prefix (FD). Currently my
assembler says:

unrecognized form of instruction `fd ABS FX.0,FX.1'

Thanks,
-
This message is subject to Imagination Technologies' e-mail terms: http://www.imgtec.com/e-mail.htm
-

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

* Re: Assembler syntax with embedded spaces
  2008-01-08 15:26 Assembler syntax with embedded spaces Will Newton
@ 2008-01-08 15:32 ` Dave Brolley
  2008-01-08 15:55   ` Will Newton
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Brolley @ 2008-01-08 15:32 UTC (permalink / raw)
  To: Will Newton; +Cc: cgen

CGEN will likely have problems with a prefix containing whitespace, i.e. 
'fd '. You will probably have to code 2 versions of the insn(s), one 
with the prefix and one without. pmacros may be useful for you here in 
order to reduce duplicate typing.

I hope this helps,
Dave

Will Newton wrote:

>Hi all,
>
>
>
>Is it possible to use CGEN to generate an assembler/disassembler for an
>
>assembler syntax with whitespace embedded in mnemonics, e.g.:
>
>
>
>FD ABS FX.0,FX.1
>
>
>
>Where "FD ABS" is the mnemonic (ABS) plus a prefix (FD). Currently my
>
>assembler says:
>
>
>
>unrecognized form of instruction `fd ABS FX.0,FX.1'
>
>
>
>Thanks,
>
>-
>
>This message is subject to Imagination Technologies' e-mail terms: http://www.imgtec.com/e-mail.htm
>
>-
>
>
>  
>

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

* Re: Assembler syntax with embedded spaces
  2008-01-08 15:32 ` Dave Brolley
@ 2008-01-08 15:55   ` Will Newton
  2008-01-08 17:46     ` Dave Brolley
  0 siblings, 1 reply; 4+ messages in thread
From: Will Newton @ 2008-01-08 15:55 UTC (permalink / raw)
  To: Dave Brolley; +Cc: Will Newton, cgen

On Jan 8, 2008 3:32 PM, Dave Brolley <brolley@redhat.com> wrote:
> CGEN will likely have problems with a prefix containing whitespace, i.e.
> 'fd '. You will probably have to code 2 versions of the insn(s), one
> with the prefix and one without. pmacros may be useful for you here in
> order to reduce duplicate typing.

I've just had a dig in the cgen source and noticed this comment in insn.scm:

; Return instruction mnemonic.
; This is computed from the syntax string.
; The mnemonic, as we define it, is everything up to, but not including, the
; first space or '$'.
; FIXME: Rename to syntax-mnemonic, and take a syntax string argument.

and opc-itab.scm:

; Strip the mnemonic part from SYNTAX.
; (ie: everything up to but not including the first space or '$')
; If STRIP-MNEM-OPERANDS?, strip them too.

I'm not sure what I want to do is possible.

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

* Re: Assembler syntax with embedded spaces
  2008-01-08 15:55   ` Will Newton
@ 2008-01-08 17:46     ` Dave Brolley
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Brolley @ 2008-01-08 17:46 UTC (permalink / raw)
  To: Will Newton; +Cc: Will Newton, cgen

Will Newton wrote:

>I've just had a dig in the cgen source and noticed this comment in insn.scm:
>
>; Return instruction mnemonic.
>; This is computed from the syntax string.
>; The mnemonic, as we define it, is everything up to, but not including, the
>; first space or '$'.
>; FIXME: Rename to syntax-mnemonic, and take a syntax string argument.
>
>and opc-itab.scm:
>
>; Strip the mnemonic part from SYNTAX.
>; (ie: everything up to but not including the first space or '$')
>; If STRIP-MNEM-OPERANDS?, strip them too.
>
>I'm not sure what I want to do is possible.
>  
>
It certainly seems that CGEN is not well suited to the assembly syntax. 
Two solutions:

1) Implement the FIXME described above
2) (ugly hack) treat the prefix as the mnemonic and the mnemonics as 
operands.

Dave


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

end of thread, other threads:[~2008-01-08 17:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-08 15:26 Assembler syntax with embedded spaces Will Newton
2008-01-08 15:32 ` Dave Brolley
2008-01-08 15:55   ` Will Newton
2008-01-08 17:46     ` Dave Brolley

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).