cmd/compile: teach rulegen to |-expand multiple |s in a single op
cmd/compile: teach rulegen to |-expand multiple |s in a single op

I want to be able to write

MOV(Q|Q|L|L|L|W|W|B)loadidx(1|8|1|4|8|1|2|1)

instead of

MOV(Qloadidx1|Qloadidx8|Lloadidx1|Lloadidx4|Lloadidx8|Wloadidx1|Wloadidx2|Bloadidx1)

in rewrite rules.

Both are fairly cryptic and hard to review, but the former
is at least compact, which helps to not obscure the structure
of the rest of the rule.

Support that by adjusting rulegen's expansion.

Instead of looking for an op that begins with "(", ends with " ",
and has exactly one set of parens in it, look for everything of the
form "(...|...)".

That has false positives: Go code in the && conditions and AuxInt expressions.
Those are easily checked for syntactically: && conditions are between && and ->,
and AuxInt expressions are inside square brackets.
After ruling out those false positives, we can keep everything else,
regardless of where it is.

No change to the generated code for existing rules.

Change-Id: I5b70a190e268989504f53cb2cce2f9a50170d8a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/166737
Run-TryBot: Josh Bleecher Snyder <cdc248cc4d32e4fbfe04e45228163bcecd48a0b9@gmail.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Cherry Zhang <d62e63aa42ce272d7b6a5055d97e942b33a34679@google.com>

nawawi/go,CAFxX/go,josharian/go,nawawi/go,nawawi/go,akutz/go,josharian/go,golang/go,golang/go,akutz/go,akutz/go,cloudflare/go,golang/go,akutz/go,CAFxX/go,josharian/go,golang/go,CAFxX/go,golang/go,akutz/go,cloudflare/go,cloudflare/go,nawawi/go,josharian/go,josharian/go,cloudflare/go,cloudflare/go,nawawi/go,nawawi/go,cloudflare/go,nawawi/go,josharian/go,josharian/go,golang/go,CAFxX/go,CAFxX/go,cloudflare/go,CAFxX/go,akutz/go,akutz/go,nawawi/go,akutz/go,josharian/go,CAFxX/go,CAFxX/go,cloudflare/go,golang/go,golang/go