[cairo] Pixman ARM Performance

Siarhei Siamashka siarhei.siamashka at gmail.com
Fri Jul 24 09:53:12 PDT 2009


On Friday 24 July 2009, Koen Kooi wrote:
> On 24-07-09 18:15, Jacob Bramley wrote:
> > As a side note, I found that the existing Neon switch in the
> > configuration file is incorrect. If Neon is detected, it sets
> > "-mcpu=cortex-a8 -mfpu=neon".

It's actually the other way around :-)

The option -mcpu=cortex-a8 is set in order to get neon actually 'detected'.
See 
http://cgit.freedesktop.org/pixman/commit/?id=767542cfb955ba22dad1259eff8a2fe16e7b8ba4
http://cgit.freedesktop.org/pixman/commit/?id=9837465fd9a5d4e7280d4c79c41d2d9a9c8f71c0

> > Neon is available on all ARMv7 cores, 
>
> You propably mean "all current armv7a (note the 'a') cores on the
> market. People used to say that every armv6 cored had vfp till qualcomm
> decided go go cheap and not include it in their msm7 series.
>
> > not
> > just Cortex-A8, so the first flag doesn't make much sense. In addition,
> > it is necessary (for some reason) to set "-mfloat-abi=softfp" to get GCC
> > to understand "-mfpu=neon". I configured and built the project by
> > specifying this in the CFLAGS environment variable.
>
> Right, this makes it possible for people to choose between softfp and
> hardfp (not suppored in gcc releases, present in the CSL2009 ones).
> Forcing pixman to softfp would mean link failures when targeting hardfp.

I would suppose that linking error would be not the worst thing (runtime
failure is much less desired). Once hardfp becomes more commonly used, some
kind of solution will have to be added to pixman at that time, and actually
tested in practice. Right now we are shooting in the dark and still have
problems (not having -mfloat-abi option is also not good for current
toolchains).

In order to solve all this in a reliable way, probably configure script can do
some extra 'gymnastics' trying to mix and match different gcc flags and trying
to find a working combination. Something like this:
1. Try to compile neon code with just standard CFLAGS, if it's OK, then we are 
fine
2. Try to add '-mfpu=neon -mfloat-abi=softfp' and then try to actually link it 
with something else
3. Try to add '-mfpu=neon -mfloat-abi=hardfp' and then try to actually link it 
with something else
4. Repeat 2. and 3. also adding -mcpu=cortex-a8 (for solving potential 
problems with PLD)

If none of these steps succeeds, then the toolchain has no support for
building NEON code or is inherently ABI incompatible or something else.


Another option is to just use plain *.S files for all the NEON assembly and
avoid dealing with all this gcc command line switches madness :-)

-- 
Best regards,
Siarhei Siamashka
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.cairographics.org/archives/cairo/attachments/20090724/60ef28b6/attachment.pgp 


More information about the cairo mailing list