[cairo] [PATCH] Added MIPS32R2 and MIPS DSP ASE optimized functions

Siarhei Siamashka siarhei.siamashka at gmail.com
Wed Sep 15 04:56:00 PDT 2010


On Monday 13 September 2010 19:21:13 Georgi Beloev wrote:
> On Sep 12, 2010, at 5:08 AM, Soeren Sandmann wrote:
> > - Is there a reason to not do runtime checking? I realize that most
> >  people using MIPS will likely do so on an embedded system where they
> >  know ahead of time what the CPU supports, but we do have runtime
> >  checking for the other CPU specific implementations.
> 
> Yes, at the present time this isn't very easy to do on MIPS Linux --
> checking if DSP ASE is implemented requires the use of privileged
> instructions. MIPS is aware of this problem and will push an update to the
> kernel that enables the use of AT_HWCAP for this purpose.

x86 is really good in this respect, providing CPUID instruction.

It would be really nice if the other architectures could standardize some way
of getting CPU capabilities from userspace without resorting to any syscalls or
other system dependent methods. For example, I would like to see it implemented
as a special CPU instruction which could either provide the needed information
itself or be trapped and emulated in the kernel. In the case if the operating 
system does not want to disclose this information to userspace, it could set 
this instruction to be emulated always, returning some special code to the
application. It's too bad that nobody cares.

Regarding runtime detection on MIPS with the current kernels. Looks like the
only possibility right now is reading and parsing the text from /proc/cpuinfo
Don't know if that is a good enough and reliable to be used in pixman.

Runtime detection is problematic on ARM too. Running on real hardware is ok.
But when run in userspace qemu on x86-64 host, currently pixman segfaults
when trying to get CPU features from "/proc/self/auxv". I tried to tweak it a
bit to work better, though it surely becomes even more hairy:
http://cgit.freedesktop.org/~siamashka/pixman/log/?h=qemu-arm-fixes

I wonder if anyone here is interested in being able to run cairo/pixman in
qemu?

At least running pixman tests in userspace qemu-mips provides an easy way to
test code for potential big endian issues even not having the big endian 
hardware.

-- 
Best regards,
Siarhei Siamashka
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100915/84c823bd/attachment.pgp>


More information about the cairo mailing list