NEON assembly fail to build for iOS in Xcode 4.3.2

拟墨画扇 提交于 2019-12-24 11:52:14

问题


I have a code base which compiles fine in all other NEON compilers, ndk-build, RVDS, etc, but under Xcode I get the error "bad instruction" for every NEON instruction I call. It basically seems like NEON is not detected.

I am attempting to build a static library, I went to New Project, selected Cocoa Touch Static Library, then added my existing files.

Everything I'm reading indicates that NEON should be already enabled. I removed all references to armv6, and am targeting iOS 5.1

Also the code in question is all contained as routines defined in ".s" files -- pure assembly. I am not using the intrinsics method calls.

It seems like the compiler is barfing on the whole file...

Unknown pseudo-op: .cpu

It lists all of the other settings, like .fpu, etc

Here are my current settings:


(source: wasteonline.net)


(source: wasteonline.net)


(source: wasteonline.net)


回答1:


After the as tool I mentioned in my last answer turned out to be choking on my syntax as well, I realized there must be something else going on.

I followed the guidelines on the bottom of this post http://www.shervinemami.info/armAssembly.html#template

The changes I needed to make were:

  1. converted my instructions to all lower case
  2. use the naming directives to be compatible with mach-o (solved linker problems)



回答2:


Try to use GCC4.2. I solved a very similar problem switching to the old, good GCC.

In Build Settings -> Compiler for C/C++/Objective-C, select GCC

Actually, if you check the LLVM ARM status page, you'll see that it cannot yet parse .S files.



来源:https://stackoverflow.com/questions/10453636/neon-assembly-fail-to-build-for-ios-in-xcode-4-3-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!