This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH [1/n] addr32: Properly use Pmode and word_mode
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, gcc-patches at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>
- Date: Sun, 4 Mar 2012 23:40:56 +0100
- Subject: Re: PATCH [1/n] addr32: Properly use Pmode and word_mode
- Authentication-results: mr.google.com; spf=pass (google.com: domain of ubizjak@gmail.com designates 10.101.7.30 as permitted sender) smtp.mail=ubizjak@gmail.com; dkim=pass header.i=ubizjak@gmail.com
- References: <20111112021931.GA26507@intel.com> <CAFULd4aPmHK1QeUUiiKTon=KvQVKCkuMtsVETJ0DeKs4Dgc-9Q@mail.gmail.com> <CAMe9rOrdeefCkf4GPcjsb__B_7L7c3itjigC9vb7gE6ATCfQGg@mail.gmail.com>
On Sun, Mar 4, 2012 at 11:01 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> @@ -13637,7 +13665,8 @@ ix86_print_operand (FILE *file, rtx x, int code)
>> ? ? ? ? ? ? ?gcc_unreachable ();
>> ? ? ? ? ? ?}
>>
>> - ? ? ? ? ix86_print_operand (file, x, 0);
>> + ? ? ? ? ix86_print_operand (file, x,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? TARGET_64BIT && REG_P (x) ? 'q' : 0);
>> ? ? ? ? ?return;
>>
>> This is too big hammer. You output everything in DImode, so even if
>> the address is in fact in SImode, you output it in DImode with an
>> addr32 prefix.
>>
>
> "%A" is only used in "jmp\t%A0" and there is no "jmp *%eax" instruction in
> 64bit mode, only "jmp *%rax":
>
> [hjl@gnu-4 tmp]$ cat j.s
> ? ? ? ?jmp *%eax
> ? ? ? ?jmp *%rax
> [hjl@gnu-4 tmp]$ gcc -c j.s
> j.s: Assembler messages:
> j.s:1: Error: operand type mismatch for `jmp'
> [hjl@gnu-4 tmp]$
>
> It is OK for x32 since the upper 32bits are zero when we are loading "%eax".
Just zero_extend register in wrong mode to DImode in indirect_jump and
tablejump expanders. If above is true, then gcc will remove this
extension automatically.
Uros.