This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC PATCH, i386]: Allow SUBREG_PROMOTED_UNSIGNED_P subregs in address
- From: Richard Henderson <rth at redhat dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Jakub Jelinek <jakub at redhat dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Wed, 20 Jul 2011 10:11:47 -0700
- Subject: Re: [RFC PATCH, i386]: Allow SUBREG_PROMOTED_UNSIGNED_P subregs in address
- References: <CAFULd4bmNZZAzJmJdW6SyRj4k-OteJkMnpCf9-p7dF624drXfg@mail.gmail.com>
On 07/20/2011 09:41 AM, Uros Bizjak wrote:
> * config/i386/i386.c (ix86_decompose_address): Also allow promoted
> paradoxical subregs in base and PLUS chains. Allow only paradoxical
> subregs and subregs of DImode hard registers in subregs of index.
> (ix86_legitimate_address_p): Allow subregs of base and index to span
> more than a word. Assert that subregs of base and index satisfy
> SUBREG_PROMOTED_UNSIGNED_P or register_no_elim_operand predicates.
The patch looks good.
It seems like one other check is required: that the mode of base and
index are the same. We've been accepting either SImode or DImode.
As long as they're both the same we get either
mov (%rax, %rdx, 4), %ebx
mov (%eax, %edx, 4), %ebx
which are both valid insns (without and with addr32 prefix). Whereas
mov (%rax, %edx, 4), %ebx
will correctly be rejected by the assembler.
r~