I have some neon optimized code that is compiled to armv7 assembly for the iPhone. Generation of arm64 code is not enabled.
Does the neon code provide any speed benefit on the newer iPhones (like iPhone 5s, 6plus) or could it run even slower than non neon code, since the 64bit processor has to somehow emulate the arm32 neon instructions?
Related
I try to follow this guide:
http://code.google.com/p/iphone-dev/wiki/Building
it wants me to build LLVM from source, but I already have one installed in Ubuntu using apt-get, why they want me to compile from source? can I use the one provided by Ubuntu community? if not, how will they coexist? should I uninstall apt-installed llvm first?
The guide you're looking at is several years out of date, and will most likely not work. (In fact, there are a ton of frustrated comments suggesting that it hasn't worked since at least 2011, as the Mac OS X 10.4u SDK is no longer available for download.)
The only supported platform for iOS development is Mac OS X. I would strongly recommend that you use that platform if you want to do iOS development, as basically all tutorials you will find online will assume that's what you're using.
That all being said, if the instructions were otherwise correct, you would still need to build LLVM separately from the version provided by Ubuntu, as iOS devices use ARM CPUs, and the distribution's LLVM will only compile binaries for your system (probably either x86 or x86-64).
OK, putting aside the obvious packaging and signing issues, would it be possible to compile IOS/iPhone compatible executables, by using correctly constructed LLVM bitcode (IR) from a non-Apple operating system, such as Linux or Windows, i.e. by utilising some combination of Open Source compiler infrastructure such as LLVM, Clang or GCC?
Basically, what I'm contemplating is
Compile a pre-existing cross-platform SDK (IOS-compatible) to LLVM Intermediate Representation (IR/bitcode).
Analyse and identify the IOS-specific LLVM (IR) function calls within this layer, using LLVM analysis tools.
After the compilation of the SDK to LLVM IR on the non-Apple system, replace the Apple/IOS-generated-LLVM-bitcode-SDK-representation within the corresponding LLVM IR function calls generated by the non-Mac host.
[possibly] employ the build flags emitted by the Mac's XCode/Clang/LLVM infrastructure, in order to build the IOS-compatible executable on the non-Apple host compilation machine (e.g. Linux or Windows).
If this is at all feasible, I would later investigate the creation of an iPhone/IOS bundle (the construction of IPA is documented, ask Google) and use the open-source Apple code-signing routines, already in use within other cross-platform IOS SDK's
RoboVM doesn't support cross-compiling iOS apps from OSes other than Mac OS yet but we plan on supporting that in the future. Here's an iOS cross-compilation toolchain which runs on Linux that may be of interest to you: https://code.google.com/p/ios-toolchain-based-on-clang-for-linux/.
Looks like Java-to-IOS is being taken care of by the RoboVM project:
Java to Native
The RoboVM compiler translates Java bytecode into native ARM or x86
code. Apps run directly on the CPU. No interpreter or virtual machine
involved.
It makes use of LLVM, as my question suggested.
Also of note is the Avian JVM project. It to can be used to compile to native and IOS binaries (by bundling the JVM), however, I'm uncertain as to the status or completeness of its user interface (UI) layer(s).
Both project appear to be in current and constant development.
When I try to archive my project for the iPhone 5 (armv7s), it comes with an error which states that RestKit is not compatible with the armv7s architecture.
In this project I'm using an old version from RestKit, version 0.9. This version is by default not capable to work with armv7s. Is there a way to setup the RestKit project (version 0.9) to support armv7s.
I've tried to add armv7s to the valid architectures for the RestKit project and changed the architectures to support armv6 and armv7. Unfortunately that didn't work out.
Of course I can setup the project with the latest version of RestKit. Only this will take a lot of time, since the core has been updated a lot of times.
Another question, would the app (build for armv6 and armv7) which is currently in the store, work on the iPhone 5 (armv7s)?
If you're unwilling to update to the latest (compatable) version, you would be better off, leaving the valid architectures as 6&7, the processor on the iPhone 5 is backwards compatable with the older architectures. The only drawback is you won't get any specific optimisations for the iPhone 5' armv7s processor.
I'd recommend checking how the RestKit guys did it in this commit: https://github.com/RestKit/RestKit/commit/29ba601cfc38560be923f57fba545881d0789ea5
and then trying to work out a way from there to get it done for your specific circumstances.
Might not be a complete solution but it's definitely a good hint.
Somehow I managed to get MAC pc OS 10.5.3. I have installed mono, monodevelop and monoTouch in that system. I have created a solution and tried to build it simply. But it is showing an error message that "C# compiler crashes". What does that mean and how to resolve that problem. I have tried installing all the software once again, but couldn't found any appropriate thread to it.
You need to provide more details about the crash but I'd venture to guess that your problem stems from not having the latest Xcode and SDKs installed. You need to be running the latest Xcode release (3.2.5 currently) to use the latest MonoTouch (3.2.3 currently) and Xcode 3.2.X requires an Intel-based Mac running Mac OS X Snow Leopard version 10.6.4 or later.
I am not sure what you mean by "somehow I managed to get MAC pc OS 10.5.3" but if that means that you've put together a hackintosh with a 10.5.3 image of OS X and you are trying to run MonoTouch on it, then you're swimming in unsupported waters. There have been reports that the simulator works fine on a hackintosh but you won't be able to deploy to the device.
I want to use Neon SIMD instruction for the iphone.
I heard we have to put flags "-mfloat-abi=softfp -mfpu=neon" in the "Other C Flags" field of the Target inspector, but when building I get "error: unrecognized command line option "-mfpu=neon"" .
Is there anything else special that has to be done to allow this flag? (I have Xcode 3.2.1 and iphone sdk 3.1.3)
Thanks !!
The NEON set is an extension on the Cortex-A series, therefore not supported in iPhone 3G. You probably cannot specify this directly.
NEON is enabled by default.
The target has to be ARMv7 for that. (3GS or later)
In order to utilize NEON, the easiest way is writing assembly codes with NEON instructions.
It isn't that hard. ARM provides NEON guide in PDF on their homepage.