This is the mail archive of the
mailing list for the GCC project.
Re: PATCH: Fix ll/sc for mips (take 3)
- From: Paul Koning <pkoning at equallogic dot com>
- To: justinca at ri dot cmu dot edu
- Cc: hjl at lucon dot org, dan at debian dot org, macro at ds2 dot pg dot gda dot pl, machida at sm dot sony dot co dot jp, libc-alpha at sources dot redhat dot com, linux-mips at oss dot sgi dot com, gcc at gcc dot gnu dot org
- Date: Mon, 4 Feb 2002 14:17:08 -0500 (EST)
- Subject: Re: PATCH: Fix ll/sc for mips (take 3)
- References: <20020131231714.E32690@lucon.org><Pine.GSO.3.96.1020201124328.26449Afirstname.lastname@example.org><20020201102943.A11146@lucon.org><20020201180126.A23740@nevyn.them.org><20020201151513.A15913@lucon.org><20020201222657.A13339@nevyn.them.org><email@example.com><20020202120354.A1522@lucon.org><firstname.lastname@example.org>
>>>>> "Justin" == Justin Carlson <email@example.com> writes:
Justin> On Sat, 2002-02-02 at 15:03, H . J . Lu wrote:
>> Does everyone agree with this? If yes, I can make a patch not to
>> use branch likely. But on the other hand, "gcc -mips2" will
>> generate code using branch likely. If branch likely doesn't buy
>> you anything, shouldn't we change gcc not to generate branch
>> likely instructions?
Justin> I know of at least one internal version of gcc which already
Justin> has been hacked to remove generation of branch likely
More precisely (if you're looking at the same one I was) -- it has a
target processor type check that disables it for those CPUs where it
is known to be not a good idea.
Justin> Also, I didn't say branch likely doesn't buy you anything;
Justin> there are situations where it works well. Looking at the
Justin> spin_lock code, though, this isn't one of them.
I agree, and I think that point was missed. Independent of whether a
particular processor (MIPS or otherwise) has the concept of "branch
likely", the design rule of spinlocks is that you try to avoid
spinning (i.e., avoid lock contention) in the system design. So for
that particular construct, the right answer is "branch not likely".