This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: [PATCH] MIPS: Implement built-in atomic memory operations.
David Daney <ddaney@avtrex.com> writes:
> Maciej W. Rozycki wrote:
>>>> For a Linux configuration with MIPS I this should also be true,
>>>> the kernel emulates ll/sc in those cases.
>>>>
>>>>
>>>>
>>> In this case could you "lie" to the compiler by passing -mips2 on the command
>>> line? Otherwise we would have to either leave it as it is or add a new
>>> command line parameter to explicitly enable ll/sc.
>>>
>>
>> I would feel a bit uneasy about adding the implication of the
>> availability of ll/sc based on the target operating system. Using a
>> switch like "-march=mips2" is unacceptable as it enables some other
>> instructions. I would be in favour to an additional option along the
>> lines of -mbranch-likely.
>>
>>
> Something like -mllsc. The default value could be set at configure time
> with --with-llsc=[true|false]. Perhaps mips*-*-linux* would imply
> --with-llsc=true unless overridden. Done in a similar manner to the
> default -march and -msoft-float settings.
>
> Perhaps Richard could opine on the matter.
Sounds fine to me. FWIW, if you'd rather not add this option yourself,
I think it's OK for the patch to go in without.
Richard