Tue Aug 23, 2011 12:17 pm
Quote from benjamin.balet on August 23, 2011, 12:17
Quote from jamesh on August 23, 2011, 09:30
There are lots of Arm websites out there that would give lots of Arm assembler tips. The Raspi uses an Arm 11 core (which I believe is Armv6 instruction set), there is nothing 'fancy' on the Arm side. (and the GPU side is already optimised with assembler where necessary).
So it's urgent to do nothing at all. Thank you for your discouraging reply.
Sorry, not meant to be discouraging. Just pointing out that there are already many Arm websites out there that would give you a good starting point for learning about Arm optimising (and Arm assembler itself which is quite different from x86). There's no point in reinventing the wheel and repeating what others have already done. Also pointing out that the RasPi uses a completely standard Arm processor, there's nothing different about it, so there isn't any need for Raspi specific optimisation - if they work on Arm they work on Raspi. That means you can go out now and write Arm code and run it in qemu or similar and it should work on the device when it comes out. And you are more than welcome to do so!
The problem with assembler is that you are of course limited to the processor its written for. Most Linux source doesn't use it so it stays cross platform compatible. Obviously there are areas in the kernel that need assembler and they need to be rewritten for each platform, but even there it's infrequently used. Also, modern compilers are generally so good that they make the move to assembler not cost effective (although Arm gcc has taken a while to get there). As you point out there are areas that can benefit, often in the multimedia area where a lot of repetitive processing is done and where saving a few cycles per pixel can really add up, but it takes a really good assembler coder to extract those cycles so for the man on the street the compiler is good enough.
With regard to the GPU, that's closed source, and already very heavily optimised in its particular assembler code (it's a propriety core, not Arm), which is really quite difficult!
All that said, I'm not trying to discourage you from writing in assembler, or writing up optimisations, just pointing out some advantages/disadvantages.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.