Hi, Jim, Why "asm" name is a horrible hack? Do you have any suggestion for cross-platform support of my ARM assembly code? Thanks! ashi On Feb 21, 2013, at 2:00 AM, Jim Grosbach <grosbach at apple.com> wrote:> You were correct the first time. That post is talking about a Windows target. Ashi is working on iOS. Underscores are normal and expected. Using an "asm" name on the symbol is a horrible hack. Adding the underscore to the name in the .s file is the correct solution. > > -Jim > > On Feb 20, 2013, at 12:04 AM, Tyler Hardin <tghardin1 at catamount.wcu.edu> wrote: > >> So it turns out that I was wrong. It, in fact, is not standard. But regardless, you can use asm to specify the exact name. Eg. >> >> extern int func() asm("func"); >> >> You can read more here: http://stackoverflow.com/questions/1034852/adding-leading-underscores-to-assembly-symbols-with-gcc-on-win32 >> Despite the title of the thread, the solution is compiler and system independent. >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130223/40459ce3/attachment.html>
Hi,all, I've some problem when using clang compile my ARM assembly code: 1 .qn directive In GAS, .qn directive is used to create typed and/or indexed register aliases for use in Advanced SIMD Extension (Neon) instructions.( http://sourceware.org/binutils/docs/as/ARM-Directives.html#ARM-Directives) But clang's integrated-as seems have different syntax, for example, my code: input .qn Q6.F32 Clang would give error: unexpected token in argument list 2 .unreq Clang doesn't recognize .unreq, my code is as below: px .req r0 .unreq px px .req r1 clang give error: redefinition of 'px' does not match original. 3 .end clang also doesn't recognize .end directive all my code is compiled by: clang -arch armv7 -v -integrated-as -g -mcpu=cortex-a9 -mfpu=neon -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/ my clang version is: Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) BTW, could any tell me which files implement integrated-as in clang source code, I think it may also help me by looking the source code(I've tried 'grep', but with no success.) Great Thanks! ashi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130225/c0c9b12c/attachment.html>
Hi, all. Another problem in ARM assembly: I use LDR to load an external symbol : LDR R7,=DataTable But clang gives error: unexpected token in operand to the '=', Then I change the code to: LDR R7,=DataTable The error becomes: unsupported relocation on symbol. How can I get around this in clang? Thanks in advance! On Mon, Feb 25, 2013 at 7:14 PM, Ashi <ashi08104 at gmail.com> wrote:> Hi,all, > I've some problem when using clang compile my ARM assembly code: > > 1 .qn directive > In GAS, .qn directive is used to create typed and/or indexed register > aliases for use in Advanced SIMD Extension (Neon) instructions.( > http://sourceware.org/binutils/docs/as/ARM-Directives.html#ARM-Directives) > But clang's integrated-as seems have different syntax, for example, my > code: > > input .qn Q6.F32 > > Clang would give error: unexpected token in argument list > > 2 .unreq > Clang doesn't recognize .unreq, my code is as below: > > px .req r0 > .unreq px > px .req r1 > > clang give error: redefinition of 'px' does not match original. > > 3 .end > clang also doesn't recognize .end directive > > all my code is compiled by: clang -arch armv7 -v -integrated-as -g > -mcpu=cortex-a9 -mfpu=neon -isysroot > /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/ > > my clang version is: Apple LLVM version 4.2 (clang-425.0.24) (based on > LLVM 3.2svn) > > BTW, could any tell me which files implement integrated-as in clang source > code, I think it may also help me by looking the source code(I've tried > 'grep', but with no success.) > > Great Thanks! > > ashi >ashi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130304/0f033b4e/attachment.html>