public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* Insns with similar mnemonics
@ 2003-06-10 11:21 Jan Zizka
  2003-06-10 14:56 ` Dave Brolley
  2003-06-10 15:14 ` Frank Ch. Eigler
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Zizka @ 2003-06-10 11:21 UTC (permalink / raw)
  To: cgen

Hi!

I have a small problem with correcly assembling following insns (only examle):

move x:(r0+symbol1),x0
move x:symbol2,x0

since the pharenteses might be aswell part of a symbol the first instruction is
interpreted as it would be second one. This will of course make r0, which is
really a register, undefined symbol. Now I have added my own parse function for
that, but it's really not elegat :(. Any suggestions? See my insn definitions
below:

(dni move13meml/allreg "move x:(Rn+xxxx),DDDDD"
	  ()
	  ("move x:($r+$imm16),$d5cap")
	  (+ (f-op-4 #xF) d5cap (f-op-bit-2/6 #x10) r imm16)
	  ()
	  ()
)

(dni move14mem/allreg "move x:imm16,DDDDD"
	  ()
	  ("move x:$imm16,$d5cap")
	  (+ (f-op-4 #xF) d5cap (f-op--7 #x54) imm16)
	  ()
	  ()
)

Thanks!
              Jan

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

* Re: Insns with similar mnemonics
  2003-06-10 11:21 Insns with similar mnemonics Jan Zizka
@ 2003-06-10 14:56 ` Dave Brolley
  2003-06-10 15:14 ` Frank Ch. Eigler
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Brolley @ 2003-06-10 14:56 UTC (permalink / raw)
  To: Jan Zizka; +Cc: cgen

I usually end up ordering the insns in the .cpu file so that the most 
restrictive insn (in your case move13meml) appears first. CGEN currently 
attempts the insns in the order in which they appear in the .cpu file. 
Even with a parse handler, this is often necessary to prevent an 
unintended variant from parsing successfully.

I've never seen this ordering behavior documented anywhere. It sould be 
nice if we could get a definitive statement in the documentation about 
it, since many existing ports rely on it.

Dave

Jan Zizka wrote:

>Hi!
>
>I have a small problem with correcly assembling following insns (only examle):
>
>move x:(r0+symbol1),x0
>move x:symbol2,x0
>
>since the pharenteses might be aswell part of a symbol the first instruction is
>interpreted as it would be second one. This will of course make r0, which is
>really a register, undefined symbol. Now I have added my own parse function for
>that, but it's really not elegat :(. Any suggestions? See my insn definitions
>below:
>
>(dni move13meml/allreg "move x:(Rn+xxxx),DDDDD"
>	  ()
>	  ("move x:($r+$imm16),$d5cap")
>	  (+ (f-op-4 #xF) d5cap (f-op-bit-2/6 #x10) r imm16)
>	  ()
>	  ()
>)
>
>(dni move14mem/allreg "move x:imm16,DDDDD"
>	  ()
>	  ("move x:$imm16,$d5cap")
>	  (+ (f-op-4 #xF) d5cap (f-op--7 #x54) imm16)
>	  ()
>	  ()
>)
>
>Thanks!
>              Jan
>  
>


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

* Re: Insns with similar mnemonics
  2003-06-10 11:21 Insns with similar mnemonics Jan Zizka
  2003-06-10 14:56 ` Dave Brolley
@ 2003-06-10 15:14 ` Frank Ch. Eigler
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Ch. Eigler @ 2003-06-10 15:14 UTC (permalink / raw)
  To: Jan Zizka; +Cc: cgen

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

Hi -

> [...]
> move x:(r0+symbol1),x0
> move x:symbol2,x0
> [...]

We have had several cgen ports, some of them public, where
parentheses were part of the assembly operand syntax.  They
work fine.  You may need to add this line in gas/config/tc-TARGET.h
to help out:

/* [...] uses '(' and ')' as punctuation in addressing mode syntax.  */
#define RELAX_PAREN_GROUPING

Dave is right about there being some order-sensitive effects
in cgen inputs, but I prefer to avoid relying on them.


- FChE

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2003-06-10 15:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-10 11:21 Insns with similar mnemonics Jan Zizka
2003-06-10 14:56 ` Dave Brolley
2003-06-10 15:14 ` 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).