[Pixman] [PATCH 3/3] MIPS: DSPr1: Basic infrastructure for DSPr1 optimizations

Siarhei Siamashka siarhei.siamashka at gmail.com
Wed Jul 24 09:16:24 PDT 2013

On Wed, 24 Jul 2013 16:24:04 +0200 Nemanja Lukic wrote:

> Hi Siarhei,
> This check (__mips_isa_rev >= 2) is just used to check for MIPS32r2 ISA
> level (not DSP ISA level).
> Officially MIPS cores, in order to support DSP ISA extensions (either DSPr1
> or DSPr2) must have at least MIPS32r2 ISA level.
> So this compile check:
> #if !(defined(__mips__) && __mips_isa_rev >= 2)
> #error MIPS DSPr1 is currently only available on MIPS32r2 platforms.
> #endif
> Is the first check that checks for MIPS32r2 ISA (as this is mandatory).
> After that comes checking for the actual DSP extension level (by trying to
> execute packrl.ph instruction).
> So this check should stay __mips_isa_rev >= 2.
> On the other hand, some MIPS-based cores, like some Broadcom SoCs, may
> support DSP extensions (r1),
> and those are MIPS32r1 ISA level, but this is not  regular scenario. And
> also, since we are currently basing
> our run-time detection for MIPS cores on parsing /proc/cpuinfo file, almost
> all Broadcom cores are not 
> supported by Pixman (since their kernel don't fill this file in proper way,
> e.g. core model is not populated as expected).

I welcome extending support to more MIPS variants, and it's surely
a good thing to have. Just the goal needs to be a bit more clear.

The point of runtime features detection is that the Linux distro
maintainers can build a single library binary, which can run on a lot
of devices and use CPU specific optimizations where they are available.

Do you know what kind of popular linux distributions are available
for MIPS right now and whether the pixman packages shipped in these
distributions are able to use DSPr2 optimizations properly?

We can use ARM as an example. The vast majority of ARM devices support
NEON SIMD, however there a few exceptions (Tegra2 and Marvell SoCs).
Because of these exceptions, Linux distributions don't enable NEON in
CFLAGS when building their packages and just target the lowest common
denominator. However pixman is still able to use NEON optimizations
even in such conservative Linux distributions as Debian thanks to
the runtime CPU features detection.

Now let's look at MIPS again. Hypothetically, some Linux distribution
may decide to build packages and select MIPS32r1 as the lowest common
denominator. And if some users install this distribution on their
MIPS32r2+DSPr2 devices, will they still benefit from the DSPr2
optimizations in pixman?

The examples of MIPS32r1 are the Broadcom SoCs that you mentioned and
also http://en.wikipedia.org/wiki/Ingenic_Semiconductor (which, I
believe, was the SoC used in real Android tablets).

Now I admit that I did not really search too hard for the relevant
MIPS related information about all this stuff. Actually, you are
probably the one who is the most interested in doing this mini
research to come up with a nice story about how your patches
are going to improve the situation in the real world :-)

Best regards,
Siarhei Siamashka

More information about the Pixman mailing list