This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode


On Mon, Mar 5, 2012 at 12:01 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Sun, Mar 4, 2012 at 11:01 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
>>> @@ -11388,6 +11400,11 @@ ix86_decompose_address (rtx addr, struct
>>> ix86_address *out)
>>> ? else
>>> ? ? disp = addr; ? ? ? ? ? ? ? ? ? ? ? /* displacement */
>>>
>>> + ?/* Since address override works only on the (reg) part in fs:(reg),
>>> + ? ? we can't use it as memory operand. ?*/
>>> + ?if (Pmode != word_mode && seg == SEG_FS && (base || index))
>>> + ? ?return 0;
>>>
>>> Can you explain the above some more? IMO, if the override works on
>>> (reg) part, this is just what we want.
>>
>> When Pmode == SImode, we have
>>
>> fs segment register == 0x1001
>>
>> and
>>
>> base register (SImode) == -1 (0xffffffff).
>>
>> We are expecting address to be 0x1001 - 1 == 0x1000. ?But, what we get
>> is 0x1000 + 0xffffffff, not 0x1000 since 0x67 address prefix only applies to
>> base register to zero-extend 0xffffffff to 64bit.
>
> I would call this a bug in the specification - I guess that
> 0x1001(%eax) works correctly.

This is how hardware works.

> We will treat this issue as a bug.
>

I also was surprised by this behavior.

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]