On 03/28/2012 03:59 PM, David Edelsohn wrote:
> On Tue, Mar 27, 2012 at 5:21 PM, Meador Inge <mead...@codesourcery.com> wrote:
>> Hi All,
>> This patch fixes an issue reported by one of our customers where an
>> exception gets raised when using '__sync_fetch_and_add' on a PowerPC 440
>> processor. The instruction causing the exception is 'lwsync'. Luckily
>> laid the groundwork when solving a similar issue for e500 cores  by
>> adding a
>> new macro ('TARGET_NO_LWSYNC') for controlling whether 'lwsync' is available
>> This patch extends the 'TARGET_NO_LWSYNC' macro to include the PowerPC 440
>> and 603 processors. The 440 because that is what the problem was reported
>> against and the 603 because problems have been reported elsewhere  about
>> that. It doesn't seem like 'lwsync' is supported on 603 processors anyway.
>> looked at the IBM  and Freescale  manuals and both use the heavyweight
>> implementation of 'sync' (i.e. the 'sync' bit L=0).
> Something does not make sense about this patch. Other than unique
> issues with e500, lwsync should be accepted everywhere. On older
> processors, the L bit is ignored and it is treated as hwsync. So I do
> not understand the need for explicit TARGET_NO_LWSYNC on PPC440 or
> Is this some sort of PPC440 errata for the specific 440 being used by
> Mentor's customer?
I am still working on getting the specific processor information. Thanks
for the lwsync info and review feedback. If I can't get the processor
specifics, then I will just drop the patch.
CodeSourcery / Mentor Embedded