« A busy new year | Main | Dead Server and Visual Studio 2010 Release »

No progress on the office yet, but I decided to like the ARM processor

My plans for a well organized office have been thwarted by a rush project targeted at Window CE.  I’ve never written anything for CE before, and have learned quite a bit about it over the last month.

First, CE isn’t the same as Windows Mobile -- CE may be customized quite a bit for the device it is targeted at.  This makes it a little challenging to build the software; especially when the client isn’t sure what the hardware folks are doing.

Second, the “recommended” tools and SDK are extremely old (based on VC 6).  Luckily, you can use the newer tools (VC 2008) as long as you’re careful about your build settings and the System API’s you are using.

Lastly, it’s amazing how dependant I’ve become on the FPU.  This project was targeted at an ARM CPU.  These don’t typically have FPUs (though it is an option).  Most of the rendering code I write uses floating point.

It’s not that ARM processors are slow, they are rather quick and I appreciate their shifting ability – it’s that floating point is emulated with a software library.  This makes it imposable to use in time sensitive areas.

It reminds me of writing for the 80386.

So, after benchmarking the rendering code and discovering just how slow the math was, it was time to implement a fixed point library.  Years ago, when Intel was still developing their XScale, they had an optimized fixed point library for the ARM.  This seems to be long gone from the Internet – I looked for it for several hours and sent several emails to Marvell without any luck.

As it turns out, my ‘C’ fixed scale code was reasonably fast, and the VC2008 compiler did a decent job of optimizing it.  After tuning the routines to prevent over and underflows the module performed quite well.

The only magic is to use 64 bit integers to multiply and divide – if you don’t have those, it’s a lot tougher.

The result was a fast software renderer, with optional support for DirectDraw and GAPI blit’ing.  It was a lot of fun to get into “old school” software mode.

TrackBack

TrackBack URL for this entry:
/cgi-bin/mt-tb.fcgi/29


Hosting by Yahoo!

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)