public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Dave Brolley <brolley@redhat.com>
To: Will Newton <will.newton@imgtec.com>
Cc: "Frank Ch. Eigler" <fche@redhat.com>, cgen@sources.redhat.com
Subject: Re: Gas error messages
Date: Wed, 14 Sep 2005 13:59:00 -0000	[thread overview]
Message-ID: <43282CBC.8090709@redhat.com> (raw)
In-Reply-To: <0D107966AF6D79418315B7C5549F4B5104DFF3@lemail1.le.imgtec.org>

Will Newton wrote:

> 
>  
>
>The assembler I am writing supports a number of addressing modes,
>expressed like:
>
>GET    D0.0,[D0.1+D0.2] ; D0.0 <- mem[base(D0.1)+offset(D0.2)]
>GET    D0.0,[D0.1+#20]  ; D0.0 <- mem[base(D0.1)+offset(20)]
>
>I have specified these a separate instrucions, e.g.:
>
>(dni ...
>    "GET $DataReg1,[$DataReg2+$DataReg3]"
>    ...
>)
>(dni ...
>    "GET $DataReg1,[$DataReg2+#$Immed]"
>    ...
>)
>
>The immediate form is parsed by my custom parser, which returns it's
>error message. However, it seems that cgen goes on to attempt to parse
>the immediate as a register name, which fails with "unrecognized
>keyword". Is there a way to control this behaviour? Once I have hit the
>hash I would like to treat the value as always an immediate.
>  
>
This will happen once you finish implementing your parse function and it 
indicates "success" by returning NULL. Right now your parse function 
stub is indicating an error, so CGEN correctly attempts other parsing 
possibilities.

Another thing to consider is that CGEN will attempt to parse the insn 
variants in the order in which they appear in the .cpu file 
(undocumented but relied on by several existing ports). You should be 
able to get the behaviour you want by defining the immediate form of the 
insn last.

I hope this helps,
Dave


  reply	other threads:[~2005-09-14 13:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-14 11:06 Will Newton
2005-09-14 13:59 ` Dave Brolley [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-09-13 16:09 Will Newton
2005-09-13 16:17 ` Frank Ch. Eigler
2005-09-13 14:51 Will Newton
2005-09-13 14:56 ` Frank Ch. Eigler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43282CBC.8090709@redhat.com \
    --to=brolley@redhat.com \
    --cc=cgen@sources.redhat.com \
    --cc=fche@redhat.com \
    --cc=will.newton@imgtec.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).