<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [powerpc-darwin][AsmPrinter] addis instruction expects 0 instead of r0"
   href="http://llvm.org/bugs/show_bug.cgi?id=18316">18316</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[powerpc-darwin][AsmPrinter] addis instruction expects 0 instead of r0
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: PowerPC
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>fang@csl.cornell.edu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>hfinkel@anl.gov, iains-llvm@btconnect.com, llvmbugs@cs.uiuc.edu, ulrich.weigand@de.ibm.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>During my stage-2 build of powerpc-darwin8 clang, stage-1 clang was found to
emit some assembly that was rejected by the system assembler (including the
'as' from odcctools-2009).  

% cat addis.s 
    addis r30, 0, 1      ; OK
    addis r30, r1, 1     ; OK
    addis r30, r0, 1     : rejected

% as addis.s -o addis.o
addis.s:3:Parameter error: r0 not allowed for parameter 2 (code as 0 not r0)

Apparently, r0 is special enough to warrant different syntax in certain
contexts.  
Would it be possible to emit such instructions differently?

The PPC darwin asm parser, accepts all of the above:

% ~/local/src/LLVM-svn/gcc40-cmake-build/bin/llvm-mc -triple
powerpc-apple-darwin8 addis.s -filetype=obj -o addis.o

I don't mind keeping that as-is, but if you want tighter conformity, you could
mimic the darwin assembler behavior.  

I think it's more important to emit darwin-asm-friendly code so that
-no-integrated-as continues to work.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>