i386: Introduce general_x64constmem_operand predicate
commit1eb68d9f414313da853da94fe1581256405c3e05
authorUros Bizjak <ubizjak@gmail.com>
Mon, 20 Feb 2023 22:17:20 +0000 (20 23:17 +0100)
committerUros Bizjak <ubizjak@gmail.com>
Mon, 20 Feb 2023 22:18:23 +0000 (20 23:18 +0100)
tree9bb935d166b52e75435976602d94c0af10b6427d
parentcd8b4fae52d02541c2d8bd2200caad3812f37368
i386: Introduce general_x64constmem_operand predicate

Instructions that use high-part QImode registers can not be encoded
with REX prefix.  To avoid REX prefix, operand constraints allow
only legacy QImode registers, immediates and constant memory operands.
The patch introduces matching predicate, so invalid operands are not
combined into instruction RTX only to be later fixed up by reload pass.

2023-02-20  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

* config/i386/predicates.md
(general_x64constmem_operand): New predicate.
* config/i386/i386.md (*cmpqi_ext<mode>_1):
Use nonimm_x64constmem_operand.
(*cmpqi_ext<mode>_3): Use general_x64constmem_operand.
(*addqi_ext<mode>_1): Ditto.
(*testqi_ext<mode>_1): Ditto.
(*andqi_ext<mode>_1): Ditto.
(*andqi_ext<mode>_1_cc): Ditto.
(*<any_or:code>qi_ext<mode>_1): Ditto.
(*xorqi_ext<mode>_1_cc): Ditto.
gcc/config/i386/i386.md
gcc/config/i386/predicates.md