TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Efficient C Code for ARM Devices

23 点作者 pietrofmaggi超过 14 年前

3 条评论

jbarham超过 14 年前
Never mind C, it's nice to see the Go ARM compiler coming along nicely (<a href="http://code.google.com/p/go/source/detail?r=3e8c5af7bb1a810f148f938110778ae3a0204442" rel="nofollow">http://code.google.com/p/go/source/detail?r=3e8c5af7bb1a810f...</a>). Pretty cool to see that Ken Thompson is still checking in code.
pmjordan超过 14 年前
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).
dpt超过 14 年前
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: <a href="http://www.davespace.co.uk/arm/efficient-c-for-arm/index.html" rel="nofollow">http://www.davespace.co.uk/arm/efficient-c-for-arm/index.htm...</a>