This is the mail archive of the mailing list for the binutils 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/MIPS] Fix Branches with a constant offset

On Wed, Jun 6, 2012 at 12:23 PM, Richard Sandiford
<> wrote:
> Andrew Pinski <> writes:
>> Hi,
>> Â After:
>> 2011-04-20 ÂCatherine Moore Â<>
>> Â Â Â Â Â Â David Ung <>..
>> Â Â Â Â * config/mips.c (mips_cl_insn): Add new field complete_p
>> ...
>> Â Â Â Â (append_insn): Move O_constant expression handling.
>> branches with a constant expression are broken by adding a relocation to them.
>> The relocation is totally wrong as it is saying it is an absolute
>> address while what we have really is an offset.
>> This patch fixes the issue with how complete_p is handled for
>> O_constant expression handling just like it was handled before this
>> patch.
>> OK? ÂTested on mips64-linux-gnu with no regressions.
> Oops. ÂIt's certainly unfortunate that we've changed the meaning
> of this case. ÂTBH though, the new version makes more sense to me.
> If you really want a constant offset, ". + X" is (and IMO always was)
> the right way to write it. ÂThe old behaviour gave oddities where:
>    Â.equ  Âx,0x1000
>    Âbeq   $4,$5,x
> would treat "x" as an offset while:
>    Âbeq   $4,$5,x
>    Â.equ  Âx,0x1000
> would treat it as an address. ÂThe new behaviour also seems to be
> consistent with other targets.
> None of which would be a convincing argument to change the behaviour
> for its own sake. ÂBut now that we've changed it anyway -- in at least
> two releases -- I'm not sure we should go back.

The MIPS AVP testsuite from MIPS has the construct of "beq     $4,$5,
48" all over the place.  This is where I ran into the behavior being
different between the two versions of bintutils.  This testsuite is
used by our hardware engineers to verify the processor.

I hope you reconsider based on a testsuite from MIPS uses this
construct.  I understand it was not consistent with other targets.
That was my first gut feeling and replied to our hardware engineers to
fix the code where they ran into it but they came back saying the AVP
testsuite uses it all over the place is it would be hard to fix.

Andrew Pinski

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