Patchwork [PPC] extend TARGET_NO_LWSYNC to cover 440 and 603 processors.

login
register
mail settings
Submitter Iain Sandoe
Date July 21, 2012, 4:12 p.m.
Message ID <05CA9A8A-0229-465E-B098-A5C0FB876F43@codesourcery.com>
Download mbox | patch
Permalink /patch/172446/
State New
Headers show

Comments

Iain Sandoe - July 21, 2012, 4:12 p.m.
Hi,

The following patch was been in use internally, for some time, to handle two further cases where the processor does not have lwsync.  Verified on a cross from i686-linux-gnu to powerpc-linux-gnu.

OK for trunk?
thanks,
Iain

	gcc/
	* config/rs6000/rs6000.h (TARGET_NO_LWSYNC): Extended to cover PPC
	440 and 603 processors.
Andrew Pinski - July 21, 2012, 4:43 p.m.
On Sat, Jul 21, 2012 at 9:12 AM, Iain Sandoe <iain@codesourcery.com> wrote:
> Hi,
>
> The following patch was been in use internally, for some time, to handle two further cases where the processor does not have lwsync.  Verified on a cross from i686-linux-gnu to powerpc-linux-gnu.
>
> OK for trunk?

This was only done for e500 and not other proessors as the e500 was
not fully compatible even with the older spec.  In that lwsync would
cause an illegal instruction exception.  This is NOT the case for 603
and the 440 so I don't think this patch should applied.

Thanks,
Andrew Pinski


> thanks,
> Iain
>
>         gcc/
>         * config/rs6000/rs6000.h (TARGET_NO_LWSYNC): Extended to cover PPC
>         440 and 603 processors.
>
> Index: gcc/config/rs6000/rs6000.h
> ===================================================================
> --- gcc/config/rs6000/rs6000.h  (revision 189745)
> +++ gcc/config/rs6000/rs6000.h  (working copy)
> @@ -501,9 +512,11 @@ extern int rs6000_vector_align[];
>                                       || TARGET_ALTIVEC                  \
>                                       || TARGET_VSX)))
>
> -/* E500 cores only support plain "sync", not lwsync.  */
> +/* E500, 440 and 603 cores only support plain "sync", not lwsync.  */
>  #define TARGET_NO_LWSYNC (rs6000_cpu == PROCESSOR_PPC8540 \
> -                         || rs6000_cpu == PROCESSOR_PPC8548)
> +                         || rs6000_cpu == PROCESSOR_PPC8548 \
> +                         || rs6000_cpu == PROCESSOR_PPC440 \
> +                         || rs6000_cpu == PROCESSOR_PPC603)
>
>
>  /* Which machine supports the various reciprocal estimate instructions.  */
>
>
Iain Sandoe - July 21, 2012, 5:04 p.m.
Hi Andrew,

On 21 Jul 2012, at 17:43, Andrew Pinski wrote:

> On Sat, Jul 21, 2012 at 9:12 AM, Iain Sandoe <iain@codesourcery.com> wrote:
>> Hi,
>> 
>> The following patch was been in use internally, for some time, to handle two further cases where the processor does not have lwsync.  Verified on a cross from i686-linux-gnu to powerpc-linux-gnu.
>> 
>> OK for trunk?
> 
> This was only done for e500 and not other proessors as the e500 was
> not fully compatible even with the older spec.  In that lwsync would
> cause an illegal instruction exception.  This is NOT the case for 603
> and the 440 so I don't think this patch should applied.

The original report, for which our change was made, was of an instruction exception caused by lwsync on 440.
I'm not personally familiar with that processor, I'll try and get access to a board/confirm in due course.

thanks
Iain



> 
> Thanks,
> Andrew Pinski
> 
> 
>> thanks,
>> Iain
>> 
>>        gcc/
>>        * config/rs6000/rs6000.h (TARGET_NO_LWSYNC): Extended to cover PPC
>>        440 and 603 processors.
>> 
>> Index: gcc/config/rs6000/rs6000.h
>> ===================================================================
>> --- gcc/config/rs6000/rs6000.h  (revision 189745)
>> +++ gcc/config/rs6000/rs6000.h  (working copy)
>> @@ -501,9 +512,11 @@ extern int rs6000_vector_align[];
>>                                      || TARGET_ALTIVEC                  \
>>                                      || TARGET_VSX)))
>> 
>> -/* E500 cores only support plain "sync", not lwsync.  */
>> +/* E500, 440 and 603 cores only support plain "sync", not lwsync.  */
>> #define TARGET_NO_LWSYNC (rs6000_cpu == PROCESSOR_PPC8540 \
>> -                         || rs6000_cpu == PROCESSOR_PPC8548)
>> +                         || rs6000_cpu == PROCESSOR_PPC8548 \
>> +                         || rs6000_cpu == PROCESSOR_PPC440 \
>> +                         || rs6000_cpu == PROCESSOR_PPC603)
>> 
>> 
>> /* Which machine supports the various reciprocal estimate instructions.  */
>> 
>>
Iain Sandoe - July 27, 2012, 7:40 a.m.
On 21 Jul 2012, at 18:04, Iain Sandoe wrote:
> On 21 Jul 2012, at 17:43, Andrew Pinski wrote:
>> On Sat, Jul 21, 2012 at 9:12 AM, Iain Sandoe <iain@codesourcery.com> wrote:

>>> The following patch was been in use internally, for some time, to handle two further cases where the processor does not have lwsync.  Verified on a cross from i686-linux-gnu to powerpc-linux-gnu.

>> This was only done for e500 and not other proessors as the e500 was
>> not fully compatible even with the older spec.  In that lwsync would
>> cause an illegal instruction exception.  This is NOT the case for 603
>> and the 440 so I don't think this patch should applied.
> 
> The original report, for which our change was made, was of an instruction exception caused by lwsync on 440.
> I'm not personally familiar with that processor, I'll try and get access to a board/confirm in due course.

To follow up on this thread and ref[1].
This is not repeatable on a 440EP.  It was reported against a device using a 440H6 core.
We have not been able to locate an erratum, so we're going to drop the patch unless/until there is a specific reproducible report of failure.
thanks
Iain

[1] http://gcc.gnu.org/ml/gcc-patches/2012-03/msg01817.html

Patch

Index: gcc/config/rs6000/rs6000.h
===================================================================
--- gcc/config/rs6000/rs6000.h  (revision 189745)
+++ gcc/config/rs6000/rs6000.h  (working copy)
@@ -501,9 +512,11 @@  extern int rs6000_vector_align[];
                                      || TARGET_ALTIVEC                  \
                                      || TARGET_VSX)))
 
-/* E500 cores only support plain "sync", not lwsync.  */
+/* E500, 440 and 603 cores only support plain "sync", not lwsync.  */
 #define TARGET_NO_LWSYNC (rs6000_cpu == PROCESSOR_PPC8540 \
-                         || rs6000_cpu == PROCESSOR_PPC8548)
+                         || rs6000_cpu == PROCESSOR_PPC8548 \
+                         || rs6000_cpu == PROCESSOR_PPC440 \
+                         || rs6000_cpu == PROCESSOR_PPC603)
 
 
 /* Which machine supports the various reciprocal estimate instructions.  */