<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1255"><base href="x-msg://1575/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Moshe,<div><br></div><div>You're more than likely going to get a better response from</div><div><br></div><div><a href="https://devforums.apple.com/community/tools/xcode">https://devforums.apple.com/community/tools/xcode</a></div><div><br></div><div>llvmdev is a mailing list for the LLVM project which is separate from Xcode development.</div><div><br></div><div>Cheers,</div><div><br></div><div>Joe</div><div><div apple-content-edited="true">
</div>
<br><div><div>On Jun 12, 2013, at 8:51 AM, Moshe Kravchik <<a href="mailto:mkravchik@hotmail.com">mkravchik@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="hmmessage" style="font-size: 12pt; font-family: Calibri; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div dir="ltr">Hi,<div><br></div><div>I've got an assembly file which used to compile with previous clang versions. However with 4.2 I get the following error:</div><div><br></div><div><div style="margin: 0px; padding: 0px; "><span style="font-family: 'Courrier New'; "><font size="3">admin$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 ./src/asm.s  -o asm.o<o:p></o:p></font></span></div><div style="margin: 0px; padding: 0px; "><span style="font-family: 'Courrier New'; "><font size="3">./src/asm.s:30:5: error: instruction requires a CPU feature not currently enabled<o:p></o:p></font></span></div><div style="margin: 0px; padding: 0px; "><span style="font-family: 'Courrier New'; "><font size="3">    add r2, pc, r2</font><span style="font-size: 9pt; "><o:p></o:p></span></span></div><div style="margin: 0px; padding: 0px; "><span style="font-size: 9pt; font-family: 'Courrier New'; "><br></span></div><div style="margin: 0px; padding: 0px; ">According to<span class="Apple-converted-space"> </span><a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489c/Cihcjfjg.html">ARM<span class="Apple-converted-space"> </span></a>specification:</div><div class="titlepage" style="font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; "><h4 class="title" style="font-size: 1.1em; clear: both; margin-top: 1.2em; margin-bottom: 0px; "><img class="toggler" id="id4666174_toggler" src="http://infocenter.arm.com/help/topic/com.arm.doc.common/images/triangle_down.png" alt="Show/hide" style="cursor: pointer; ">Use of PC and SP in Thumb instructions</h4></div><div id="id4666174_contents" style="font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-top: 0.4em !important; margin-bottom: 0.2em !important; "><div style="margin: 0.8em 0px 0.2em; padding: 0px; ">In most of these instructions, you cannot use PC (<code class="literal" style="color: rgb(51, 51, 153); font-family: 'Lucida Sans Typewriter', 'Courier New', Courier, monospace; font-size: 0.9em; ">R15</code>) for <code class="literal" style="color: rgb(51, 51, 153); font-family: 'Lucida Sans Typewriter', 'Courier New', Courier, monospace; font-size: 0.9em; "><em class="replaceable">Rd</em></code>, or any operand.</div><div style="margin: 0.8em 0px 0.2em; padding: 0px; ">The exceptions are:</div><div class="itemizedlist"><ul type="disc" style="margin-top: 0.8em; margin-bottom: 0.2em; "><li style="margin-top: 0.6em; margin-bottom: 0.2em; "><div style="margin: 0.4em 0px 0.2em; padding: 0px; ">you can use PC for <code class="literal" style="color: rgb(51, 51, 153); font-family: 'Lucida Sans Typewriter', 'Courier New', Courier, monospace; font-size: 0.9em; margin-top: 0.4em; margin-bottom: 0.2em; "><em class="replaceable" style="margin-top: 0.4em; margin-bottom: 0.2em; "><code style="color: inherit; font-family: inherit; margin-top: 0.4em; margin-bottom: 0.2em; ">Rn</code></em></code> in 32-bit Thumb <code class="code" style="color: rgb(51, 51, 153); font-family: 'Lucida Sans Typewriter', 'Courier New', Courier, monospace; font-size: 0.9em; margin-top: 0.4em; margin-bottom: 0.2em; ">ADD</code> and <code class="code" style="color: rgb(51, 51, 153); font-family: 'Lucida Sans Typewriter', 'Courier New', Courier, monospace; font-size: 0.9em; margin-top: 0.4em; margin-bottom: 0.2em; ">SUB</code> instructions, with a constant <code class="literal" style="color: rgb(51, 51, 153); font-family: 'Lucida Sans Typewriter', 'Courier New', Courier, monospace; font-size: 0.9em; margin-top: 0.4em; margin-bottom: 0.2em; "><em class="replaceable" style="margin-top: 0.4em; margin-bottom: 0.2em; "><code style="color: inherit; font-family: inherit; margin-top: 0.4em; margin-bottom: 0.2em; ">Operand2</code></em></code> value in the range 0-4095, and no <code class="literal" style="color: rgb(51, 51, 153); font-family: 'Lucida Sans Typewriter', 'Courier New', Courier, monospace; font-size: 0.9em; margin-top: 0.4em; margin-bottom: 0.2em; ">S</code> suffix. These instructions are useful for generating PC-relative addresses. Bit[1] of the PC value reads as 0 in this case, so that the base address for the calculation is always word-aligned.</div></li><li style="margin-top: 0.6em; margin-bottom: 0.2em; "><div style="margin: 0.4em 0px 0.2em; padding: 0px; ">you can use PC in 16-bit Thumb <code class="code" style="color: rgb(51, 51, 153); font-family: 'Lucida Sans Typewriter', 'Courier New', Courier, monospace; font-size: 0.9em; margin-top: 0.4em; margin-bottom: 0.2em; ">ADD{<em class="replaceable" style="margin-top: 0.4em; margin-bottom: 0.2em; "><code style="color: inherit; font-family: inherit; margin-top: 0.4em; margin-bottom: 0.2em; ">cond</code></em>} Rd, Rd, Rm</code> instructions, where both registers cannot be PC.</div><div style="margin: 0.4em 0px 0.2em; padding: 0px; "><br></div><div style="margin: 0.4em 0px 0.2em; padding: 0px; "><br></div><div style="margin: 0.4em 0px 0.2em; padding: 0px; ">I indeed specified that this line belongs to the Thumb function. But the clang still produces this error.</div><div style="margin: 0.4em 0px 0.2em; padding: 0px; "><br></div><div style="margin: 0.4em 0px 0.2em; padding: 0px; ">When I compile this file directly with "as" it compiles correctly.</div><div style="margin: 0.4em 0px 0.2em; padding: 0px; "><br></div><div style="margin: 0.4em 0px 0.2em; padding: 0px; "><br></div><div style="margin: 0.4em 0px 0.2em; padding: 0px; ">Please help!</div><div style="margin: 0.4em 0px 0.2em; padding: 0px; "><br></div><p style="margin: 0.4em 0px 0.2em; padding: 0px; "> </p></li></ul></div></div></div></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></div><br></div></body></html>