On Tue, Mar 6, 2012 at 10:27 PM, H.J. Lu <hjl.to...@gmail.com> wrote:
>>>>>> +     case '^':
>>>>>> +       if (TARGET_64BIT && Pmode == SImode)
>>>>>> +         {
>>>>>> +           fputs ("addr32", file);
>>>>>> +#ifndef HAVE_AS_IX86_REP_LOCK_PREFIX
>>>>>> +           if (ASSEMBLER_DIALECT == ASM_ATT)
>>>>>> +             fputs ("addr32; ", file);
>>>>>> +           else
>>>>>> +#endif
>>>>>> +             fputs ("addr32 ", file);
>>>>>> +         }
>>>>>
>>>>> Why do you print addr32 twice? "addr32addr32; " or "addr32addr32 ".
>>>>
>>>> Oops, please remove the first one.
>>>>
>>>
>>> It looks OK to me.  I will test after I fix indirect jmp/call.
>>
>> FYI, addr32 prefix can't stand alone (but "addr32 rep; insn" is OK),
>> so #ifndefed part is bogus.
>>
>
> I changed it to
>
> +  case '^':
> +    if (TARGET_64BIT && Pmode == SImode)
> +      fputs ("addr32 ", file);
> +    return;
>
> and it seems to work.

Committed with slight adjustment to above code

+       case '^':
+         if (TARGET_64BIT && Pmode != word_mode)
+           fputs ("addr32 ", file);
+         return;
+

2012-03-07  Uros Bizjak  <ubiz...@gmail.com>

        * config/i386/i386.c (ix86_print_operand_punct_valid_p): Add '^'.
        (ix86_print_operand): Handle '^'.
        * config/i386/i386.md (*strmovdi_rex_1): Macroize memory operands
        using P mode iterator.  Add %^ to asm template to conditionally emit
        addr32 prefix.
        (*rep_movdi_rex64): Ditto.
        (*strsetdi_rex_1): Ditto.
        (*rep_stosdi_rex64): Ditto.
        (*strmov{si,hi,qi}_1): Add %^ to asm template to
        conditionally emit addr32 prefix.
        (*rep_mov{si,qi}): Ditto.
        (*strset{si,hi,qi}): Ditto.
        (*rep_stos{si,qi}): Ditto.
        (*cmpstrnqi_nz_1): Ditto.
        (*cmpstrnqi_1): Ditto.
        (*strlenqi_1): Ditto.

Re-tested on x86_64-pc-linux-gnu.

Uros.

Reply via email to