Support multiple operand counts for .md @ patterns

Programming / Compilers / GCC - rsandifo [138bc75d-0d04-0410-961f-82ee72b054a4] - 12 July 2019 07:54 EDT

This patch extends the support for "@..." pattern names so that the patterns can have different numbers of operands. This allows things like binary and ternary operations to be handled in a consistent way, a bit like optabs. The generators assert that the number of operands passed is correct for the underlying instruction.

Also, replace_operands_with_dups iterated over the old rtx format even after having decided to do a replacement, which broke with match_operator.

2019-07-12 Richard Sandiford

gcc/
- doc/md.texi: Document that @ patterns can have different numbers of operands.
- genemit.c (handle_overloaded_gen): Handle this case.
- genopinit.c (handle_overloaded_gen): Likewise.
- gensupport.c (replace_operands_with_dups): Iterate over the new rtx's format rather than the old one's.

f8533207f8f Support multiple operand counts for .md @ patterns
gcc/ChangeLog | 9 ++++++++
gcc/doc/md.texi | 9 ++++++++
gcc/genemit.c | 65 +++++++++++++++++++++++++++++---------------------------
gcc/genopinit.c | 62 +++++++++++++++++++++++++++++++----------------------
gcc/gensupport.c | 2 ++
5 files changed, 91 insertions(+), 56 deletions(-)

Upstream: gcc.gnu.org


  • Share