4 ms·
Wow, amazing performance tuning, so rare these days! However, you should be careful with this online ARM simulator. It simulates Cortex-A8 while iPhone 5 runs
by Marat_Dukhan 13y ago
Wow, amazing performance tuning, so rare these days!
However, you should be careful with this online ARM simulator. It simulates Cortex-A8 while iPhone 5 runs on Apple Swift, two generations ahead. It very likely has different instruction timings compared to Cortex-A8. I didn't have a chance to test Swift, but here is a list of what might be different, judging by Qualcomm Krait and ARM Cortex-A15, which are in the same generation:
- Instead of 2-cycle latency on Cortex-A8 simple ALU instructions might have 3-cycle latency on Krait (this is the case on Krait and Cortex-A15).
- Cortex-A8 can issue only 64-bit SIMD multiplication per cycle, Swift probably can do 128-bit VMUL.Ix each cycle (Krait does).
- Cortex-A8 can issue only one SIMD ALU instruction per cycle, Swift probably can do more (Cortex-A15 can issue 3 128-bit VADD/VAND/etc in 2 cycles).
- Cortex-A8 could issue one SIMD ALU + one SIMD LOAD/SHUFFLE per cycle, Swift could be less restrictive (and probably even can issue 3 NEON instructions per cycle, like Cortex-A15).
- jpap 13y agoThat's really cool, Marat. Thanks for the additional info on the A15 and Swift. It's a lot of work to optimize the assembly code to each ARM variant, but glad to know that Swift will generally run the same code at the same or faster speeds as the Cortex-A8. The 3-cycle latency on simple ALU instructions is a bummer, but fortunately I use them sparingly for computation as compared to NEON. (They're great for pointer arithmetic and computing image row strides.) The multiple issue of an ALU + LOAD is awesome. That would definitely help some of my routines.
- Marat_Dukhan 13y agoThe 3-cycle latency refers to simple NEON ALU instructions (VADD.Ix, VORR, VAND, etc). Scalar ALU instructions are still single-cycle. Note that these numbers are from Cortex-A15 and Krait which are expected to be similar to Swift, but I didn't measure Swift itself to know for sure.