Where can I find an explanation of $src1, $src2, $in, $ptr, etc.?

I have read through the TableGen Fundamentals documentation and been browsing various .td files. One thing that is not clear to me is where things like $src1 (as in GR32:$src1) are defined, and what they mean. The TableGen Fundamentals page seems silent on this, and I have not found other documentation that explains it. Browsing through the .td files has not helped, either (although that has been quite useful to clarify things that are not spelled out in detail on the TableGen Fundamentals page).

Thanks,

Mark

It's not entirely clear what you're referring to, but in general, those are just arbitrary operand names. They are defined and used within the instruction patterns. If that doesn't help, perhaps you could post a specific example that you're having trouble with.

I’ve also been curious about this and couldn’t find any documentation. By looking at the other TD files I can tell basically what it does but, It would be nice to have documentation saying that $var is a variable and what can and can not be done with it.

I think I might have answered my own question with a little more browsing and your mention of “arbitrary operand names”. It appears that the syntax here is recordkind:$name where ‘recordkind’ has been previously defined, and ‘name’ is just a descriptive name attached to a particular dag node input, which may (or may not) be referred to later in the definition of the current record.

Is that correct?

Mark

Mark Lacey <641@rudkx.com> writes:

I think I might have answered my own question with a little more browsing and your mention of "arbitrary operand names". It appears
that the syntax here is recordkind:$name where 'recordkind' has been previously defined, and 'name' is just a descriptive name attached
to a particular dag node input, which may (or may not) be referred to later in the definition of the current record.

Is that correct?

Yep. They are defined in the (ins) and (outs) "dags" so that TableGen
knows how to treat them.

There's a lot of black magic in TableGen in that some innocuous-looking
empty defs ("ins," "outs," "set," etc.) are actually hard-coded to be
recognized as special values in the TableGen tool's C++ code.

                            -Dave