Add null identifiers to genmatch
commit9bac11b75df2ea37ee667b39bef3015aef857332
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Nov 2015 18:48:23 +0000 (17 18:48 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Nov 2015 18:48:23 +0000 (17 18:48 +0000)
treebdc10567de14ef2c88576714c0c54d848ad98243
parent3a18d05c6e55490e20387ffed5a7a41582cd4f38
Add null identifiers to genmatch

This patch adds a null identifier that can never match anything and
can never be generated.  It is only valid in operator lists and fors.
Later patches will add uses of it.

The idea is to allow operator lists for maths functions that have
four entries:

- float built-in
- double built-in
- long double built-in
- internal function

Not all maths functions have an associated internal function,
and for those the final operator will be "null".  Any simplification
that tries to use a null substitution will be skipped.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* doc/match-and-simplify.texi: Document the "null" identifier.
* genmatch.c (id_base::NULL_ID): New kind.
(null_id): New variable.
(get_operator): Add a parameter that says whether null identifiers
are allowed.
(contains_id): New function.
(lower_for): Skip substitutions that would have a null_id in
either the match or the result.
(parser::parse_for): Allow the null identifier to be used.
(parser::parse_operator_list): Likewise.
(main): Initialize null_id.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230485 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/doc/match-and-simplify.texi
gcc/genmatch.c