From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Brolley To: "Frank Ch. Eigler" Cc: cgen@sources.redhat.com Subject: Re: escaping in syntax strings Date: Mon, 26 Mar 2001 09:11:00 -0000 Message-id: <3ABF7866.40608@redhat.com> References: <20010326081015.D13900@redhat.com> X-SW-Source: 2001-q1/msg00211.html Yes -- see the fr30 for an example of this: h-r13 -- hardware element R13 -- special operand r13base-ld -- pmacro for generating insns which have r13 hardwired but still specified Dave Frank Ch. Eigler wrote: > I wrote: > > : [...] > : By the way, why do you need a "$" in the syntax string? Are you > : confusing register name keywords or hexadecimal constants with > : the markers that actually belong into the syntax strings? > > I just found what Ben was talking about. It seems that some > instructions in the assembly language for his target includes dummy > operands that make explicit the implicit (not-encoded) operands. For > example, given a register keyword set such as "$0 .. $7", there are > some instructions which are hard-wired to use only $0 as an input or > output, in addition to other inputs/outputs. Rather than leave the $0 > implicit, this assembly language expects the programmer to specify it. > Say, > compare $0,$2,$3 > instead of > compare $2,$3 > > So, Ben is trying to implement this in the assembler by including the > literal string "$0" in the syntax bytes of the instruction. This is > not too bad, though a possibly better way would be to associate a > synthetic cgen operand with that slot, and to give it a parser that > accepts only "$0", and emits a helpful error message for anything > else. > > - FChE > >