PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

evc4 compiler comparison

I have copied the evc4 compilers to evc3 (just copy the exes to replace the ones already there. Make sure to make a backup).

I haven't done much testing, but I have compiled the EasyCE2 library & sample with both versions with all optimization settings. Here are the exe sizes (all for StrongARM):

evc3/default optimizations: 76.5 KB (78,336 bytes)
evc3/maximize speed: 53.0 KB (54,272 bytes)
evc3/minimize size: 71.5 KB (73,216 bytes)
evc4/default optimizations: 76.0 KB (77,824 bytes)
evc4/maximize speed: 57.0 KB (58,368 bytes)
evc4/minimize size: 76.5 KB (78,336 bytes)

I haven't profiled the code, but another program I compiled ran at ~30fps with evc4 and ~50fps with evc3. I didn't test the optimizations with that though.

I haven't even looked at any of the additional features evc4 supposedly have.

All in all, the evc4 compilers certainly work, but whether it is beneficial to use them instead remains to be seen (I think they will probably be found to be worse)
Thanks for posting your results. The difference in file sizes isn't that interesting though. I'd be more interested in code generation leading to performance improvements. Please post anything you discover in this regard.
I have looked a little more. Firstly, it seems that evc4 has a lot more intrisinc functions (It has support for all the XScale instructions and 32x32-64 multiplies). You need to copy the include file from the CE.NET SDK to use them. Fortunately, installing the CE.NET SDK doesn't interfere with evc3.

I tried to create a program that used try/catch. First it complained that I needed to set a compiler switch to enable exception handling. When I did that, it screwed up another part of my program (If I commented the try keyword and the catch block it worked fine).

The include files for CE.NET are organized into seperate directories for each compiler. I haven't gotten around to doing a diff on the folders yet, so I'm not sure if they are different. The two files I looked at had #ifdef's for some processors, so I'm not sure why they are different.

The debug SH3 compiler gave an "internal error" at the end of one of the functions (The MsgProc from the "Hello World" sample from the wizard). The release compiler worked for it though.

Finally, it seems that the MIPS compiler has a problem with one of the header files. The fix is basically to comment out the line it complains about.

These are all the issues I have found so far.

As for performance, the main indicator of performance (for RISC machines like every WinCE processor) is the number of instructions executed. Everything else that affects performance is difficult at best for a C(++) compiler to optimize. So far only one x86 compiler has found a way to improve cache usage and pipelining (VectorC. I can't remember where the website is. It does it by having #pragma statements that tell how the compiler is allowed to unroll loops and re-order instructions). In any case, the best way to help pipeline/cache problems is smart programming. If your program is well designed, a compiler won't help/hurt you much. The main optimizations a compiler can do (without user interaction) is re-use computation results, optimize register usage, and stuff like that. For more about that, go to www.azillionmonkeys.com/qed/

Finally (for the second time), since the WinCE executable format seems to be pretty close to that of Win32, I'm supprised nobody has ported GCC to compile for WinCE. It should be no easier/harder than porting it to compile for Win32 (GCC does support ARM and MIPS and SH3. It might even support XScale (probably not, though))

Eventually (soon hopefully), I will compare the assembly output of evc3 and evc4 (Probably only for Release ARM w/ maximize speed) for some common routines (I'll probably take some of them from a web site I found a while ago that compared different compilers. I can't remember where it was, though, only that there was a link on the Lua site).
You'll need support in your OS for C++ EH for it to work properly, and Pocket PC 2002 doesn't have it.