Accept code attributes as rtx codes in .md files
authorRichard Sandiford <richard.sandiford@arm.com>
Sun, 12 May 2019 11:28:01 +0000 (11:28 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sun, 12 May 2019 11:28:01 +0000 (11:28 +0000)
commit75df257b38bd4cdcb750fc893c5023363230cfe8
treec3e45e445fd98056a3ab6ec685befd4449426000
parent4c0164573e213045052ca6bc3113d7d63cf62816
Accept code attributes as rtx codes in .md files

The recent AArch64 absolute difference patterns had to go through
some hoops to pair max/min rtx codes with the same signedness.
I also need to pair signed/unsigned codes with sign/zero extension
for some SVE ACLE patterns.

This patch therefore supports <...> as rtx codes, like we already
do for modes.

2019-05-12  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* doc/md.texi: Document use of code attributes in rtx patterns.
* read-md.h (rtx_reader::rtx_alloc_for_name): New member function.
* read-rtl.c (find_code): Split out search loops into...
(maybe_find_code): ...this new function.
(check_code_iterator): Make the error message more informative.
(check_code_attribute): New function.
(rtx_reader::rtx_alloc_for_name): Likewise.
(rtx_reader::read_rtx_code): Use rtx_alloc_for_name.
* config/aarch64/predicates.md (aarch64_smin, aarch64_umin): Delete.
* config/aarch64/aarch64-simd.md (*aarch64_<su>abd<mode>_3): Use
<max_opp> directly as an rtx code instead of via a match_operator.
* config/aarch64/aarch64-sve.md (aarch64_<su>abd<mode>_3): Likewise.
(<su>abd<mode>_3): Update accordingly.

From-SVN: r271107
gcc/ChangeLog
gcc/config/aarch64/aarch64-simd.md
gcc/config/aarch64/aarch64-sve.md
gcc/config/aarch64/predicates.md
gcc/doc/md.texi
gcc/read-md.h
gcc/read-rtl.c