On 10/13/2016 04:08 PM, David Malcolm wrote:
I thought it might be useful to brainstorm [1] some ideas on this,
so  here are various possible ways it could be printed for this use-case:

* Offset by LAST_VIRTUAL_REGISTER + 1 (as in the patch), and printed
just as a number, giving:

  (reg:SI 3)

Unambiguous in the compact format, nice low register numbers, but some potential for confusion with hard regs based on what people are used to.

* Prefixed by a "sigil" character:

>   (reg:SI %3)

Avoids the confusion issue and shouldn't overlap with hard register names. I think this is the one I prefer, followed by plain (reg:SI 3).

  (reg:SI P3)

Can't use this, as there are machines with P3 registers.

* Prefixed so it looks like a register name:

  (reg:SI pseudo-3)
  (reg:SI pseudo_3)
  (reg:SI pseudo+3)

Not too different from just a "%" prefix and probably too verbose.

Looking at print_rtx_operand_code_r there are also things like
ORIGINAL_REGNO, REG_EXPR and REG_OFFSET which get printed after the
main regno, e.g.: >

  (reg:SI 1 [ <retval> ])

That's the REG_EXPR here presumably? The interesting part comes when parsing this.


Reply via email to