Sid Manning
2013-Aug-01 14:15 UTC
[LLVMdev] Case sensitive .macros for llvm-mc and arithmetic in expressions
I have come across some assembly that assumes macro names are not case sensitive. My first reaction is to have the user fix the code until I found out that gas .macro names are not case sensitive. While this isn't the exact code, it is representative of the problem: #--- .macro sUm from=0, to=5 .long \from .if \to-\from sum "(\from+1)",\to .endif .endm sum 0, 5 #--- Results in the following error: sum.s:9:1: error: invalid operand for instruction sum 0, 5 I have attached a patch that might be all that is needed to fix case sensitivity. In another case there is an expression like this: #--- .Ltmp1: .long 0xdeadbeef .Ltmp7: .long 0xdeadbeef .Ltmp22: .long (.Ltmp7-.Ltmp1) - .Ltmp22 #--- The above results in this error: LLVM ERROR: expected relocatable expression The above seems like it should work, and if .Ltmp22 is replaced by a number it does. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation -------------- next part -------------- A non-text attachment was scrubbed... Name: macro.diff Type: text/x-patch Size: 894 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130801/49cf400a/attachment.bin>
Apparently Analagous Threads
- [LLVMdev] LLVMdev Digest, Vol 85, Issue 50
- [LLVMdev] [cfe-dev] Code generation for noexcept functions
- [LLVMdev] LLVMdev Digest, Vol 85, Issue 50
- [LLVMdev] Runtime linker issue wtih X11R6 on i386 with -O3 optimization
- [PATCH] kbuild, x86: revert macros in extended asm workarounds