[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: jpeg-turbo 6.2 and ppc G3



On Tue, Jul 5, 2016 at 9:01 PM, Lennart Sorensen
<lsorense@csclub.uwaterloo.ca> wrote:
> On Tue, Jul 05, 2016 at 07:46:10PM +0200, Riccardo Mottola wrote:
>> Hi Lennart,
>>
>> Lennart Sorensen wrote:
>> >On Sat, Jul 02, 2016 at 08:57:56AM +0200, Riccardo Mottola wrote:
>> >>I what test program could I use? I noticed that e.g. Firefox (which works)
>> >>is not linked against it.
>> >You could try forcing altivec off in libjpegturbo by setting the environment:
>> >
>> >export JSIMD_FORCENONE=1
>>
>> that works! Once set, the application loads several JPG files without
>> issues.
>
> So it turns out libjpeg-turbo has NO runtime detection on powerpc and
> just assumes altivec is valid.
>
> This untested patch might work:
>
> --- simd/jsimd_powerpc.c.orig   2016-07-05 14:57:48.305763762 -0400
> +++ simd/jsimd_powerpc.c        2016-07-05 14:58:04.453763762 -0400
> @@ -32,7 +32,10 @@
>    if (simd_support != ~0U)
>      return;
>
> -  simd_support = JSIMD_ALTIVEC;
> +  if (__builtin_cpu_supports("altivec"))
> +    simd_support = JSIMD_ALTIVEC;
> +  else
> +    simd_support = 0;
>
>    /* Force different settings through environment variables */
>    env = getenv("JSIMD_FORCENONE");

Well it does not work -yet- at least on ppc32 with gcc 6.1.1:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71777

But I would report the bug anyway to libjpegturbo. Riccardo, could you do that?

thx


Reply to: