This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: add pa2.0 system instructions



law> 
law>   In message <14213.7688.994516.981768@gargle.gargle.HOWL>you write:
law>   > For what it's worth, if we can free up a bunch of codes I can get ldw
law>   > relatively clean (no extra state vars) using about 5 or 6 new codes.  How
law>   > does yours work?
law> 
law> /* new syntax 32bit loads */
law> { "ldw",        0x0c000080, 0xfc001fc0, "cx(s,b),t", pa10, FLAG_STRICT},
law> { "ldw",        0x0c000080, 0xfc001fc0, "cx(b),t", pa10, FLAG_STRICT},
law> { "ldw",        0x0c001080, 0xfc001fc0, "C5(s,b),t", pa10, FLAG_STRICT},
law> { "ldw",        0x0c001080, 0xfc001fc0, "C5(b),t", pa10, FLAG_STRICT},
law> { "ldw",        0x4c000000, 0xfc000000, "\017\020(s,b),x", pa10, FLAG_STRICT},
law> { "ldw",        0x4c000000, 0xfc000000, "\017\020(b),x", pa10, FLAG_STRICT},
law> { "ldw",        0x5c000004, 0xfc000006, "\017\021(s,b),x", pa20, FLAG_STRICT},
law> { "ldw",        0x5c000004, 0xfc000006, "\017\021(b),x", pa20, FLAG_STRICT},
law> 
law> /* old syntax 32bit loads */
law> { "ldw",        0x48000000, 0xfc000000, "j(s,b),x", pa10},
law> { "ldw",        0x48000000, 0xfc000000, "j(b),x", pa10},

This looks similar to mine, except I used 'l' and 'L' for long offsets, and
'm' for the completer.  Also I didn't have a strict syntax flag.

law> It's important to realize that without some kind of stricter syntax checking
law> it is impossible to correctly parse something like this using the new syntax:
law> 
law>   ldw 5(0,4),9
law> 
law> That could be equivalent to either of these instructions (old syntax)
law> 
law>   ldwx %r5(%sr0,%r4),%r9	/* Indexed load */
law> 
law>   or
law> 
law>   ldw  5(%sr0,%r4),%r9  /* reg + d load */
law> 
law> 
law> In the old syntax, this case was disambiguated by using different opcodes, but
law> in the new case we have a single opcode.

Perhaps I don't understand here, but this doesn't seem ambiguous to me.  There
isn't ambiguity in the 0, 4, or 9.  In the old syntax, 5 can only be a
displacement.  In the new syntax, you have to use %r5 for a register, no?  The
HP assembler (rightly I think) decides that this must be a displacement, not
an index register.

As long as the code that grabs the 5 displacement doesn't also try to cast it
to a register, we should be fine.  However, so far, I've only made myself
really familiar with the main code processing loop, not the full extent of the
other number handling stuff, so I could be off base here.

Jerry




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]