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



  In message <14213.7688.994516.981768@gargle.gargle.HOWL>you write:
  > For what it's worth, if we can free up a bunch of codes I can get ldw
  > relatively clean (no extra state vars) using about 5 or 6 new codes.  How
  > does yours work?

/* new syntax 32bit loads */
{ "ldw",        0x0c000080, 0xfc001fc0, "cx(s,b),t", pa10, FLAG_STRICT},
{ "ldw",        0x0c000080, 0xfc001fc0, "cx(b),t", pa10, FLAG_STRICT},
{ "ldw",        0x0c001080, 0xfc001fc0, "C5(s,b),t", pa10, FLAG_STRICT},
{ "ldw",        0x0c001080, 0xfc001fc0, "C5(b),t", pa10, FLAG_STRICT},
{ "ldw",        0x4c000000, 0xfc000000, "\017\020(s,b),x", pa10, FLAG_STRICT},
{ "ldw",        0x4c000000, 0xfc000000, "\017\020(b),x", pa10, FLAG_STRICT},
{ "ldw",        0x5c000004, 0xfc000006, "\017\021(s,b),x", pa20, FLAG_STRICT},
{ "ldw",        0x5c000004, 0xfc000006, "\017\021(b),x", pa20, FLAG_STRICT},

/* old syntax 32bit loads */
{ "ldw",        0x48000000, 0xfc000000, "j(s,b),x", pa10},
{ "ldw",        0x48000000, 0xfc000000, "j(b),x", pa10},

'c', 'C' and '\017' are potential completers.  

'x' only accepts a register of the for "%r<num" when in strict mode.

'5' is a short offset
'\020' and '\021' are long offsets

If the operand in the assembly file does not satisfy the letter, then we
"break" which indicates that the selected insn did not match.  Then we go on
to the next potential insn.

This is how most gas assemblers work (fail and try next insn).  The old PA
syntax did not lend itself to that kind of scheme.

It's important to realize that without some kind of stricter syntax checking
it is impossible to correctly parse something like this using the new syntax:

  ldw 5(0,4),9

That could be equivalent to either of these instructions (old syntax)

  ldwx %r5(%sr0,%r4),%r9	/* Indexed load */

  or

  ldw  5(%sr0,%r4),%r9  /* reg + d load */


In the old syntax, this case was disambiguated by using different opcodes, but
in the new case we have a single opcode.

jeff


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