3 ms·
When I joined the iPhone dev team, about a week after the first iPhone came out, I came in as an experienced reverse-engineer on x86/PPC but had never touched A
by daeken 16y ago
When I joined the iPhone dev team, about a week after the first iPhone came out, I came in as an experienced reverse-engineer on x86/PPC but had never touched ARM. Within a few weeks (after writing a dead simple decompiler, among other things), it became one of my favorite ISAs. Why? Conditional execution and free shifting.
They touch on conditional execution, but they don't really point out how amazing it is. It makes conditional math code, if nothing else, insanely simple and elegant, not to mention fast as hell.
As for the free shifts, I'm sort of amazed they aren't touched on in the article -- they make life very easy. In ARM, you can do a shift on the result of most instructions. E.g. you can do add r0, r1, r2, LSL #4, which is equivalent to r0 = (r1 + r2) << 4. If you're commonly dealing with powers of two, this is an absolute godsend.
- ZPedro 16y agoAh, a kindred spirit, I too am an assembly/ISA buff. However, if you pay attention you'll notice that this article is precisely not for ISA buffs: as I've written, I wouldn't have mentioned conditional execution if not for the debugging side effect. It is aimed at ordinary iOS developers who may be carrying assumptions from desktop architectures and not realize some ARM specificities that may impact them; I titled it "[…]things iOS developers ought to know[…]", not "hey, did you know about that cool thing?". Hence why I didn't mention free shifting (and it's the second operand that can be shaf-- er, shifted, IIRC).