Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Efficient C Code for ARM Devices (eetimes.com)
23 points by pietrofmaggi on Nov 5, 2010 | hide | past | favorite | 3 comments


Never mind C, it's nice to see the Go ARM compiler coming along nicely (http://code.google.com/p/go/source/detail?r=3e8c5af7bb1a810f...). Pretty cool to see that Ken Thompson is still checking in code.


Interesting that they completely ignore dynamic branching, but I guess the target audience are mostly classical "embedded" developers rather than mobile app devs. If you're writing iOS apps in Objective-C, you're paying a penalty for every method call, as it goes through the objc_msgSend() dispatch mechanism every time. I'm extremely surprised Apple haven't added more "clever" optimisations to the compiler, such as a JVM-like call site cache for de-facto monomorphic calls. (hacking clang/llvm to do that is an item on my endless list of things to do on a rainy day) This would essentially allow branch prediction and instruction prefetching on messages for a vast majority of cases. C++ virtual calls are typically cheaper than Objective-C messages but can also benefit from this sort of treatment (just not as much).


I presented a course on this subject to engineers at my former employer. It's a set of tips about how to improve C code for ARM targets: http://www.davespace.co.uk/arm/efficient-c-for-arm/index.htm...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: